Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. I'm using the componentDidMount which setState for the props of this input value.
  2.  
  3.  
  4.  
  5. state = {
  6. rent:null
  7. }
  8.  
  9. componentDidMount(){
  10. if(this.props.house.rent){
  11. this.setState({rent:this.props.house.rent});
  12. }
  13. }
  14.  
  15. render(){
  16. <input
  17. type = "text"
  18. value={this.state.rent}
  19. }
  20.  
  21.  
  22. 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