Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- I'm using the componentDidMount which setState for the props of this input value.
- state = {
- rent:null
- }
- componentDidMount(){
- if(this.props.house.rent){
- this.setState({rent:this.props.house.rent});
- }
- }
- render(){
- <input
- type = "text"
- value={this.state.rent}
- }
- The expected value is after I empty the input value, It should not appear the next time I visit the page, but it appears again, and gets removed only after I refresh the page.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement