-
Notifications
You must be signed in to change notification settings - Fork 842
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
onSkinChange
prop
#165
Comments
Sure! 👍
Mmm, I guess my initial thought was to not allow skin change from the props when the user decides they want a certain skin tone. Props would be a way to set the default, but how can we tell if we should use the prop vs. the user’s choice? Perhaps a boolean |
Hmm. Is there a use case where you'd change the // '6' in store
<Picker {...props} /> // => skinTone is 6
<Picker {...props} skinTone={2} /> // => skinTone is 2
// nothing in store
<Picker {...props} /> // => skinTone is 1
<Picker {...props} skinTone={2} /> // => skinTone is 2 Does this make sense? |
But if props is more important than store, then as soon as you pass a skin tone the user’s choice would be ignored. If that was to be the case, should passing |
I guess the best thing would be to handle all the use cases:
Would give max control to devs. Sounds like something that would work for you? |
Sure, sounds good. Although I suppose, that would introduce a breaking change into the API, is that okay? |
Cool, thank you! |
I see at some point in time, we had onSkinChange callback. But we don't anymore. We need to store skin tone for different users in our users' settings. Is it possible to return this prop? @EtienneLem |
@EtienneLem Is there any chance you could bump the @emoji-mart/data and @emoji-mart/react packages on npm to include this feature? We'd be grateful if you could! |
oh strange, I looked at the source and see the react package is a thin wrapper around the base package. But searching the source I don't see |
Hi! Thank you for the great library!
I've encountered a use case where I need to do something whenever a skin tone is selected in the picker. I propose we add an
onSkinChange
prop toPicker
's API. I can submit a pull request if you think this is a good idea.EDIT:
Also, because of this line, it's impossible to change the picker's skin tone from the outside of if the skin tone is already set in the store. That's also a use case I'm personally interested in. Is there any reason why we have to check if skin tone is present in the store?
The text was updated successfully, but these errors were encountered: