diff --git a/src/EmojiKeyboard.tsx b/src/EmojiKeyboard.tsx index 659d3c7..10d0e5a 100644 --- a/src/EmojiKeyboard.tsx +++ b/src/EmojiKeyboard.tsx @@ -79,7 +79,7 @@ export const EmojiKeyboard = () => { scrollEnabled={false} // onScroll={onScroll} initialNumToRender={1} - windowSize={7} + windowSize={1} maxToRenderPerBatch={1} /> diff --git a/src/components/EmojiCategory.tsx b/src/components/EmojiCategory.tsx index ee788d1..f0ce81b 100644 --- a/src/components/EmojiCategory.tsx +++ b/src/components/EmojiCategory.tsx @@ -25,7 +25,7 @@ export const EmojiCategory = ({ item }: { item: CategoryTypes }) => { const { width } = useWindowDimensions(); const ctx = React.useContext(KeyboardContext); const numberOfColumns = React.useRef( - Math.floor(width / (ctx.emojiSize + 20)) + Math.floor(width / (ctx.emojiSize * 2)) ); const [empty, setEmpty] = React.useState([]); @@ -48,22 +48,6 @@ export const EmojiCategory = ({ item }: { item: CategoryTypes }) => { }); const renderItem = React.useCallback( - // (props) => { - // if (props.item.slug === 'blank_emoji') - // return ( - // - // ); - // else - // return ( - // - // ); - // }, (props) => ( void; emojiSize: number; -}) => { - if (item.slug !== 'blank_emoji') +}> { + shouldComponentUpdate() { + return false; + } + render() { return ( - onPress(item)} style={styles.container}> - - {item.emoji} + this.props.onPress(this.props.item)} + style={styles.container} + > + + + {this.props.item.emoji} + ); - else return ; -}; + } +} + +// export const SingleEmoji = ({ +// item, +// onPress, +// emojiSize, +// }: { +// item: EmojiType; +// onPress: (emojiObject: EmojiType) => void; +// emojiSize: number; +// }) => { +// if (item.slug !== 'blank_emoji') +// return ( +// onPress(item)} style={styles.container}> +// +// {item.emoji} +// +// +// ); +// else return ; +// }; const styles = StyleSheet.create({ container: { flex: 1, padding: 8 },