-
Notifications
You must be signed in to change notification settings - Fork 1
TextField
aaron ngu edited this page Nov 12, 2019
·
1 revision
-
title
title for the text field -
size
Short | Long -
onChange
CallBack function with 'event' as a parameter. And to access user input call event.target.value. Example: handleChange(event){console.log(event.target.value)} to log the user text input onto console.
Usage:
import TextField from './components/textField/textField.jsx;
class Page extends React.Component(){
constructor(props) {
super(props)
this.state = {myState: None};
}
handleChange(event) {
this.setState({
myState : event.target.value
})
};
function YourComponent(){
return(
<div>
<TextField title='Email' size='Short' onChange={this.handleChange}/>
</div>
);
}
}