Skip to content

Issues when using frimousse with TypeScript versions below 5.1 #17

@Earthsplit

Description

@Earthsplit

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions