Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a type definition file for @emoji-mart/data in @emoji-mart v5? #733

Closed
hatsu38 opened this issue Nov 12, 2022 · 4 comments · Fixed by #745
Closed

Is there a type definition file for @emoji-mart/data in @emoji-mart v5? #733

hatsu38 opened this issue Nov 12, 2022 · 4 comments · Fixed by #745

Comments

@hatsu38
Copy link

hatsu38 commented Nov 12, 2022

I am using emoji-mart v3 in a TypeScript project.
I would like to upgrade to Emoji-mart v5.

import data from '@emoji-mart/data'
import Picker from '@emoji-mart/react'

function App() {
  return (
    <Picker data={data} onEmojiSelect={console.log} />
  )
}

When I write the above code, I get the following error
Is there any way to upgrade to emoji-mart v5 in a TypeScript project?
スクリーンショット 2022-11-12 19 40 03

Cannot find module '@emoji-mart/data' or its corresponding type declarations.

@kmlbss
Copy link

kmlbss commented Nov 13, 2022

I'm having the same problem in my next js application.
I seacrhed about it and found that you can install @emoji-mart/react and import data from it. this was not the solution for me again..

@arnovanstaden
Copy link

arnovanstaden commented Nov 16, 2022

TS complained it could not find a declaration file for '@emoji-mart/react'

Adding declare module '@emoji-mart/react'; to my global.d.ts file solved the issue for me.

@phil-loops
Copy link

phil-loops commented Nov 17, 2022

I am using emoji-mart v3 in a TypeScript project. I would like to upgrade to Emoji-mart v5.

We were in a similar situation. I still don't know how to get accurate types, but this solution allowed me to at least load the component.

@hatsu38
Copy link
Author

hatsu38 commented Nov 18, 2022

Thank you! I tried your solution and it worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants