Created
October 31, 2020 07:32
-
-
Save akulsr0/96db57db059db38d56287bea1259fe67 to your computer and use it in GitHub Desktop.
React Native UI - Emoji
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from 'react'; | |
import { | |
View, | |
TextInput, | |
} from 'react-native'; | |
import Emoji from 'react-native-emoji'; | |
export default function App() { | |
const [emojiName, setEmojiName] = useState('fire'); | |
return ( | |
<View style={{ flexDirection: 'row', alignItems: 'center' }}> | |
<TextInput | |
style={{ | |
flex: 1, | |
marginRight: 10, | |
backgroundColor: '#f3f3f3', | |
paddingHorizontal: 10, | |
height: 40, | |
borderRadius: 6, | |
}} | |
placeholder='Emoji Name' | |
defaultValue='fire' | |
onChangeText={(text) => setEmojiName(text)} | |
autoCapitalize='none' | |
autoCompleteType='off' | |
/> | |
<Emoji name={emojiName} style={{ fontSize: 40 }} /> | |
</View> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment