Write emoji by emoji code
Demo
Installation
npm install react-native-emoji-hook
Usage
import useEmoji, { emojify } from 'react-native-emoji-hook';
// ...
const [text, setText] = useEmoji();
emojify function is not hook it is basically text to emoji text converter. you can use this for making own custom useState.
Example Code
import * as React from 'react';
import { StyleSheet, View, TextInput } from 'react-native';
import useEmoji from 'react-native-emoji-hook';
export default function App() {
const [text, setText] = useEmoji();
return (
<View style={styles.container}>
<TextInput style={styles.input} value={text} onChangeText={setText} />
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
},
input: {
width: '100%',
height: 100,
backgroundColor: 'gray',
fontSize: 30,
},
});
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT