We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
componentDidMount 里 setState render 不执行。
class Page109 extends Component { constructor(props) { super(props); this.state = { show: false } } componentDidMount() { this.setState({ show: true }, () => { console.log(`componentDidMount here: `) console.log(`this.state: `, this.state) }) } render() { let img = utils.isSupportWebp() ? require('./assets/1.webp') : require('./assets/1.jpg') console.log(`render state: `, this.state) return ( <div className="page109"> <img className="imgs" src={img} alt=""/> <div className="box"> <img src={require('./assets/2.jpg')}/> {this.state.show ? <ul className=""> 我是内容 </ul> : ""} </div> </div> ) } } export default Page109
The text was updated successfully, but these errors were encountered:
https://code.h5jun.com/haxer/edit?html,js,console,output 直接用你的 DEMO 试了下并没有问题诶
Sorry, something went wrong.
No branches or pull requests
componentDidMount 里 setState render 不执行。
The text was updated successfully, but these errors were encountered: