skip to Main Content

Can anyone help me solve why nothing is showing on the screen when I try to change the value of parent’s prop using a click event?

export default class App extends React.Component { constructor(props){ super(props); this.state={ show:true } } render() { const toggleDisplay=()=>{ this.setState({show:!this.state.show}); } return ( <div className="App"> {this.show&&<ChildrenUnmounting onclickfun={toggleDisplay} />} </div> ); } } class ChildrenUnmounting extends React.Component { constructor(props) { super(props); alert("constructor is…

VIEW QUESTION
Back To Top
Search