Skip to content

Instantly share code, notes, and snippets.

@KrisKnez
Last active August 20, 2024 12:55
Show Gist options
  • Save KrisKnez/46f151946e4be99047dfbd402969f2b4 to your computer and use it in GitHub Desktop.
Save KrisKnez/46f151946e4be99047dfbd402969f2b4 to your computer and use it in GitHub Desktop.
em-emoji props
/*
This is the solution to the following error:
Property 'em-emoji' does not exist on type 'JSX.IntrinsicElements'.ts(2339)
*/
// Define em-emoji web component inside React
// https://github.com/missive/emoji-mart#-emoji-component
interface EmEmojiProps {
id?: string
shortcodes?: string
native?: string
size?: string
fallback?: string
set?: 'native' | 'apple' | 'facebook' | 'google' | 'twitter'
skin?: 1 | 2 | 3 | 4 | 5 | 6
}
declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace JSX {
interface IntrinsicElements {
'em-emoji': EmEmojiProps
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment