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

Error if the emoji doesn't exist #14

Closed
DonovanCharpin opened this issue Oct 10, 2016 · 3 comments
Closed

Error if the emoji doesn't exist #14

DonovanCharpin opened this issue Oct 10, 2016 · 3 comments

Comments

@DonovanCharpin
Copy link

Hi guys

I tried to use the Emoji component with an emoji that doesn't exist.

For instance, with :thumbsup:, it doesn't work :

<Emoji
          key={i}
          sheetURL={'/images/sheet_apple_32.png'}
          emoji={{ id: 'thumbsup', skin: 3 }}
          size={20}
        />

I have this error in the console :

emoji-mart.js?78ec:1041
Uncaught TypeError: Cannot read property 'skin_variations' of undefined
@DonovanCharpin
Copy link
Author

DonovanCharpin commented Oct 12, 2016

Seems to be in the utils/index.js. It's missing a check :

if (emojiData && emojiData.skin_variations && skin > 1 && sheetURL) {

I don't know why but I wasn't able to import my fork with npm to test it but pretty sure the error is in getData if emojiData is undefined.

@EtienneLem
Copy link
Member

Yes, pretty easy to reproduce indeed. Thanks, will fix ASAP.

@DonovanCharpin
Copy link
Author

Great, just waiting that to push the feature in production. Thanks

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

No branches or pull requests

2 participants