Here is my Profile class :
class Profile extends React.Component {
state={email:'',userName:'',userID:''};
render() {
return(
<div>
...
<Link to={{pathname:"/edit",state:this.props.state}}>
...
</div>
);
}
}
export default Profile;
And here is my ProfileEdit class :
class ProfileEdit extends React.Component {
state={email:'',userName:'',userID:''};
render() {
return(
<div>
...
<TextField valueOfEmail={this.state.userID}/>
...
</div>
);
}
}
export default ProfileEdit;
And here is my TextField class :
class TextField extends React.Component {
render() {
const {valueOfEmail}=this.props;
return (
<div>
<div className="form-label-group">
<input type="text" id="inputEmail" value={valueOfEmail} className="form-control" placeholder="Name" required autoFocus/>
<label htmlFor="inputEmail">Enter Name</label>
</div>
</div>
);
}
}
export default TextField;
It gives me error sometimes and sometime it doesn't, but it renders nothing.
Here is the error I have got :
I have used "react-router-dom": "^5.0.1"
How to resolve this and pass value correctly using <Link/> or something better.(Except redux - still learning)

valueprop to aninputyou need to provide anonChangehandler. If you don't wish to handle change yourself, pass value usingdefaultValueprop, notvalue. The error message is quite self-explanatory, does it even requires any explanation.