美文网首页
React入门的一点摘录

React入门的一点摘录

作者: 朱云鹤 | 来源:发表于2017-12-17 13:02 被阅读0次

    If you don’t use something in render(),it shouldn’t be in the state.

    setState()automatically merge a partial state into the current state.

    In React,sharing state is accomplished by moving it up to the closest common ancestor of the components that need it.

    Instead of trying to sync the state between different components,you should rely on the top-down data flow.

    Remember that components may accept arbitrary props,including primitive values,React elements,or functions.

    相关文章

      网友评论

          本文标题:React入门的一点摘录

          本文链接:https://www.haomeiwen.com/subject/fvmywxtx.html