2017-09-07 3 views
0
'use strict'; 

import React from 'react'; 
import { 
    View, 
    StyleSheet, 
    Text, 
    Image, 
    TextInput, 
} from 'react-native'; 

var Login = React.createClass({ 
    render: function() { 
     return (
      <View style={styles.container}> 
       <Text style={styles.heading}>My First App</Text> 
       <TextInput 
        style={styles.input} 
        placeholder='User name'> 
       </TextInput> 
       <TextInput 
        style={styles.input} 
        placeholder='Password' 
        secureTextEntry='true'> 
       </TextInput> 
      </View> 
     ); 
    } 
}); 

var styles = StyleSheet.create({ 
    container: { 
     backgroundColor: '#FFFFFF', 
     padding: 16, 
    }, 
    heading: { 
     fontSize: 30, 
     marginTop: 10, 
     textAlign: 'center', 
    }, 
    input: { 
     height: 50, 
     marginTop: 10, 
     padding: 4, 
     fontSize: 18, 
     borderWidth: 1, 
     borderColor: '#112233' 
    } 

}); 

export default Login; 

Error while updating property 'secureTextEntry' of a view managed by: AndroidTextInput TypeError: expected dynamic type boolean', but had type string' updateViewProp ViewManagersPropertyCache.java:95 setProperty ViewManagerPropertyUpdater.java:129 updateProps ViewManagerPropertyUpdater.java:48 updateProperties ViewManager.java:36 createView NativeViewHierarchyManager.java:227 execute UIViewOperationQueue.java:150 dispatchPendingNonBatchedOperations UIViewOperationQueue.java:923 doFrameGuarded UIViewOperationQueue.java:895 doFrame GuardedFrameCallback.java:31 doFrame ReactChoreographer.java:136 doFrame ChoreographerCompat.java:107 run Choreographer.java:869 doCallbacks Choreographer.java:683 doFrame Choreographer.java:616 run Choreographer.java:857 handleCallback Handler.java:751 dispatchMessage Handler.java:95 loop Looper.java:154 main ActivityThread.java:6123 invoke Method.java run ZygoteInit.java:867 main ZygoteInit.java:757AndroidTextInput TypeError: dynamique de type `boolean 'mais avait de type` chaîne'

prévu

S'il vous plaît me aider à corriger cette erreur

Répondre

0

secureTextEntry = {true} au lieu de la chaîne, a déclaré type booléen intérieur bouclés accolades fixes

<TextInput 
    style={styles.input} 
    placeholder='Password' 
    secureTextEntry={true}> 
</TextInput>