For status-related displays of HTML elements, you can either define an if ( range ) directly in the render() block or
{ this.state.ok === true && ( //--< Buttons >-- <Link href="/" onClick={this.onClickSubmit}> <Fab color="secondary" > <RemoveRedEye /> </Fab> </Link> ) //--</ Buttons >-- } |
embed expressions in JSX
{ state-Wert mit && ( HTML ) }
True
At this.state.visible_Variable = true
False
At this.state.visible_Variable = false
Die State Variable sollte im Contructor definiert sein.
export class Edit extends Component { //--------< component: Article >--------
//----< compontent >---- baseURL = "/";
constructor(props) { //-< react: parameter > super(props); //-</ react: parameter > //--< react: variables >-- this.state = { idarticle: 0, iduser: "", title: "", textcontent: "", htmlcontent: "", folder: "", keywords: "", nimages: "", nvideos: "", nfiles: "", dtcreated: "", dtedit: "", loading: true, status: "", ok: false, }
this.onClickSubmit = this.onClickSubmit.bind(this); //for using this.function() in component } |