Skip to content

TextInput, unrecognized selector sent to instance XXX onChangeText #14583

Description

@awitherow

Description

I have a text input,

<TextInputstyle={styles.input}onChangeText={text=>this.setState({username: text})}value={username}editableplaceholder={!Boolean(username)&&'Username'}/>

When I attempt to put in the first change of text, this error gets thrown for iOS.

I am using the create-react-native-app and am unsure if this is a react-native issue or an expo, or whatever else in this stack... not very easy to debug to me.

screen shot 2017-06-18 at 16 30 31

Reproduction Steps

https://github.com/awitherow/sales-admin-app/pull/3

Set up, run with Expo XDE and use iOS simulator. Go to IDENTITY tab and attempt to log in.

Sample Code

//@flowimportReactfrom'react';import{KeyboardAvoidingView,View,Text,TouchableOpacity,StyleSheet,TextInput,Platform,}from'react-native';import{components,metrics,colors}from'../../theme';exportdefaultclassSecurityextendsReact.Component{constructor(props){super(props);this.state={username: '',password: '',};}validateForm=()=>this.state.username.length>0&&this.state.password.length>0;render(){const{ username, password }=this.state;return(<Viewstyle={styles.form}><Viewstyle={styles.formHeader}><Textstyle={[styles.heading,styles.text]}>
Welcome to the Marketplace.
</Text><Textstyle={[styles.subHeading,styles.text]}>
Login, or register, below.
</Text></View><KeyboardAvoidingViewstyle={styles.formBody}><TextInputstyle={styles.input}onChangeText={text=>this.setState({username: text})}value={username||''}editableplaceholder={!Boolean(username)&&'Username'}/><TextInputstyle={styles.input}onChangeText={text=>this.setState({password: text})}value={password||''}editableplaceholder={!Boolean(password)&&'Password'}secureTextEntry/></KeyboardAvoidingView><Viewstyle={styles.formFooter}><TouchableOpacitystyle={styles.button}><Textstyle={styles.buttonText}>Login</Text></TouchableOpacity><TouchableOpacitystyle={styles.button}><Textstyle={styles.buttonText}>Register</Text></TouchableOpacity><TouchableOpacitystyle={styles.button}><Textstyle={styles.buttonText}>Learn More</Text></TouchableOpacity></View></View>);}}

Solution

Not sure where this is coming from or if I need to make this ticket in another part of this stack.

Additional Information

  • React Native version: 0.44
  • Platform: iOS
  • Development Operating System: OS X
  • Build tools: Create-React-Native-App

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions