Всем привет! стараюсь прокинуть данные в state
что бы иметь возможность изменять значение инпута
class Profile extends Component{
constructor(props){
super(props);
this.editProfileBind = this.editProfile.bind(this);
this.testEmailBind = this.testEmail.bind(this); }
testEmail(e){
const input = e.target;
this.setState({
email: input.value
});
input.value = this.state.email;
}
editProfile(e){
e.preventDefault();
}
render(){
return(
<form className="col-md-4 col-xs-6"
onSubmit={this.editProfileBind}>
<input type="email"
className="form-control"
placeholder="Email"
ref="email"
onChange={this.testEmailBind}
value={this.props.email || ''}
/>
<button type="submit"
className="btn btn-default">Submit</button>
</form>
)
}
} // end component
export default createContainer(() => {
const user = Meteor.user();
const email = user.emails && user.emails[0].address;
return { email };
}, Profile);
Подскажите, как передать в инпут this.state.email
вместо this.props.email
что бы изменять его состояние.
Спасибо.