-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(react): return type of Delay should be JSX.Element (#898)
# Overview <!-- A clear and concise description of what this pr is about. --> same reason with previous PRs ## PR Checklist - [x] I did below actions if need 1. I read the [Contributing Guide](https://github.com/suspensive/react/blob/main/CONTRIBUTING.md) 2. I added documents and tests.
- Loading branch information
Showing
3 changed files
with
23 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@suspensive/react": patch | ||
--- | ||
|
||
fix(react): return type of Delay should be JSX.Element |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import type { ReactNode } from 'react' | ||
import { Delay } from './Delay' | ||
|
||
describe('<Delay/>', () => { | ||
it('type check', () => { | ||
expectTypeOf( | ||
<Delay> | ||
<></> | ||
</Delay> | ||
).toEqualTypeOf<JSX.Element>() | ||
expectTypeOf( | ||
<Delay> | ||
<></> | ||
</Delay> | ||
).not.toEqualTypeOf<ReactNode>() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters