React Component

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/http188188/article/details/83573795

1、The render() function should be pure, meaning that it does not modify component state, it returns the same result each time it’s invoked, and it does not directly interact with the browser.

If you need to interact with the browser, perform your work in componentDidMount() or the other lifecycle methods instead. Keeping render() pure makes components easier to think about.在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/http188188/article/details/83573795