I encountered an issue using frimousse with TypeScript versions below 5.1. Specifically when using components that return ReactNode as the return type.
In TypeScript versions before 5.1, you can't use ReactNode in one specific case - typing the return type of a component (as explained in this article)
This causes TypeScript errors like:
'FrimousseEmoji.Empty' cannot be used as a JSX component.
Its return type 'ReactNode' is not a valid JSX element.
Type 'undefined' is not assignable to type 'Element | null'.ts(2786)
After upgrading to TypeScript 5.1 or higher, the issue is resolved.
Would it be possible to:
- Mention the minimum required TypeScript version (>= 5.1) in the README or documentation?
- Add
typescript as a peerDependency field in package.json to prevent issues for users on older versions?
Thanks for the great work on this library!
I encountered an issue using frimousse with TypeScript versions below 5.1. Specifically when using components that return
ReactNodeas the return type.In TypeScript versions before 5.1, you can't use
ReactNodein one specific case - typing the return type of a component (as explained in this article)This causes TypeScript errors like:
After upgrading to TypeScript 5.1 or higher, the issue is resolved.
Would it be possible to:
typescriptas apeerDependencyfield inpackage.jsonto prevent issues for users on older versions?Thanks for the great work on this library!