Commit e96b0be
committed
fix: add explicit return types
The return type of `NumericFormat` and `PatternFormat` was being inferred as
`JSX.Element` which caused the following type error (typescript v5.7.3):
```
error TS2786: 'PatternFormat' cannot be used as a JSX component.
Its type '<BaseType = InputAttributes>(props: PatternFormatProps<BaseType>) => Element' is not a valid JSX element type.
Type '<BaseType = InputAttributes>(props: PatternFormatProps<BaseType>) => Element' is not assignable to type '(props: any) => ReactNode | Promise<ReactNode>'.
Type 'Element' is not assignable to type 'ReactNode | Promise<ReactNode>'.
Property 'children' is missing in type 'Element' but required in type 'ReactPortal'.
```
Instead of being inferred, explicitly add the return type of `React.ReactElement`
which represents a JSX element.1 parent 8de2517 commit e96b0be
2 files changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
566 | 566 | | |
567 | 567 | | |
568 | 568 | | |
569 | | - | |
| 569 | + | |
570 | 570 | | |
571 | 571 | | |
572 | 572 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
268 | | - | |
| 268 | + | |
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
| |||
0 commit comments