Skip to content

Instantly share code, notes, and snippets.

@akulsr0
Created October 31, 2020 07:32
Show Gist options
  • Save akulsr0/96db57db059db38d56287bea1259fe67 to your computer and use it in GitHub Desktop.
Save akulsr0/96db57db059db38d56287bea1259fe67 to your computer and use it in GitHub Desktop.
React Native UI - Emoji
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