How to use TextInput.Icon(?)
See original GitHub issueHello guys, I’m new using this for developing my apps.
I’m using TextInput for phone number and wanna include some icon. but when I try to implementation like in the docs, the Icon showing missing icon like ‘X’.
“react-native”: “0.60.5”, “react-native-paper”: “^4.1.0”, “react-native-vector-icons”: “^7.1.0”,
here my app.js
import React, { Component } from 'react';
import { Provider as PaperProvider } from 'react-native-paper';
import Navigation from './src/navigasi/navigation';
// export const store = configureStore()
export default class App extends Component {
render() {
return (
<PaperProvider>
<Navigation />
</PaperProvider>
)
}
}
here’s my navigation.js
const HomeNav = () => (
<Stack.Navigator
headerMode='none'
initialRouteName="SplashScreen"
>
<Stack.Screen options={ModalAnimate} name='SplashScreen' component={SplashScreen} />
<Stack.Screen options={SlideAnimate} name='Login' component={Login} />
<Stack.Screen options={SlideAnimate} name='HomeDashboard' component={HomeDashboard} />
</Stack.Navigator>
)
here my implementation the textinput in login.js.
function TextInput_() {
const [text, setText] = React.useState('');
return (
<TextInput
label="No. Handphone"
value={text}
onChangeText={text => setText(text)}
left={
<TextInput.Icon
name="heart"
/>
}
/>
)
}
here’s the image:
so, I wanna ask how to using this TextInput.Icon or what I’ve missing?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:7
Top Results From Across the Web
How can I put an icon inside a TextInput in React Native?
put both Icon and TextInput inside a parent View · set flexDirection of the parent to 'row' which will align the children next...
Read more >TextInput.Icon · React Native Paper
A component to render a leading / trailing icon in the TextInput. ... Usage. import * as React from 'react'; import { TextInput...
Read more >Image inside TextInput Example - Expo Snack
Example of Image inside React Native Text Input.
Read more >Image Icon in React Native TextInput
Image Icon In React Native TextInput are very good way to assist user about what to insert in a TextInput. Here is the...
Read more >textInputIcon: Create a text input control with icon(s) - Rdrr.io
Extend form controls by adding text or icons before, after, or on both sides of a classic textInput . Usage. textInputIcon( inputId, label, ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If it’s your local image just add
left={<TextInput.Icon name={require(‘…/…/assets/newIcons/expert.png’)} />}
for vector icon: right={<TextInput.Icon name=“eye” />}
Make sure the icons are loading properly this is not react native paper issue. https://github.com/oblador/react-native-vector-icons#the-icons-show-up-as-a-crossed-out-box-on-android