arronhunt / react-native-emoji-selector

⚛️😎 Simple, customizable and theme-able Emoji selector for React Native
https://www.npmjs.com/package/react-native-emoji-selector
MIT License
296 stars 111 forks source link

Add ability to disable categories #35

Open bkwhite opened 4 years ago

bkwhite commented 4 years ago

It would be very helpful if categories could be disabled via component props

arronhunt commented 4 years ago

I'm thinking through the best pattern to achieve something like this. Instead of disabling certain categories I feel its more intuitive to whitelist them. We could have an API like this

import EmojiSelector, { Categories } from "react-native-emoji-selector";

const { flags, sports, food } = Categories;

<EmojiSelector
  onEmojiSelected={handleEmoji}
  categoriesEnabled={[
    flags, sports, food
  ]}
/>
bkwhite commented 4 years ago

I like that approach, it also aligns with our use case well.

arronhunt commented 3 years ago

This will be included in v1.0.0