"Text input React native"
Bootstrap 4.1.1 Snippet by RachnaKhatnawlia

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
//import liraries
import React from 'react';
import { View, StyleSheet, TextInput } from 'react-native';
import colors from '../styles/colors';
import fontFamily from '../styles/fontFamily';
import { moderateScale, moderateScaleVertical, textScale } from '../styles/responsiveSize';
// create a component
const CommonInput = ({
placeholderTxt,
secureTextEntry,
inputContainer, input,
onChangeTxt,
value,
editable,
selectTextOnFocus,
keyboardType
}) => {
return (
<View style={{
...styles.inputContainer,
...inputContainer
}}>
<TextInput
style={{ ...styles.input, ...input }}
placeholder={placeholderTxt}
placeholderTextColor={colors.white}
secureTextEntry={secureTextEntry}
onChangeText={onChangeTxt}
value={value}
editable={editable}
selectTextOnFocus={selectTextOnFocus}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
<CommonInput
placeholderTxt={strings.MOBILE_NUMBER}
keyboardType="numeric"
inputContainer={{ marginRight: moderateScale(0) }}
onChangeTxt={(phone) => updateState({ phone })}
/>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: