企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state. Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state. ``` class Bight extends React.Component { constructor(props){ super(props); this.state = { value:this.props.value } } handleClick(){ this.setState({ value:'X' }) } render(){ return( <div> <Skt onClick={this.handleClick()}>{this.state.value}</Skt> </div> ) } } ``` ``` class Bight extends React.Component { constructor(props){ super(props); this.state = { value: null } } handleClick(){ this.setState({ value:'X' }) } render(){ return( <div> <Skt onClick={this.handleClick()}>{this.state.value}</Skt> </div> ) } } ``` ``` <Skt onClick={this.handleClick()}>{this.state.value}</Skt> ``` ``` getv(i){ return ( <Skt onClick={()=>this.handleClick()} value={this.state.value}></Skt> ) } ```