美文网首页
React Koans 学习笔记

React Koans 学习笔记

作者: debt | 来源:发表于2016-08-17 16:22 被阅读19次

    React的两个重要属性 props和state

    • Properties - we pass these values when we create a component. They don't change during the component's lifecycle.
    • State - these values can change over entire life of the component.When you change some value in state object, React will re-calculate the render method and update the HTML to match the new state (in this case, updating the class).

    普通回显小技巧 如果在input中绑定onChange事件 event.target.value 就可以得到输入框的值


    相关文章

      网友评论

          本文标题:React Koans 学习笔记

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