加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

What is state and props

发布时间:2020-12-15 16:17:19 所属栏目:百科 来源:网络整理
导读:? State,in React component,is internal dataset which affects the rendering of the component. To some extent state can be considered as the private data or data model of React components. React component state is mutable. Once the internal

?

State,in React component,is internal dataset which affects the rendering of the component. To some extent state can be considered as the private data or data model of React components.

React component state is mutable. Once the internal state of a React component is changed,the component will re-render itself according to the new state.

Props,which is short for properties,are properties of React component. Props look like HTML attributes. Values of props in a React component are commonly passed from the parent component.

Props are just passed into,so props are immutale in the eyes of the child components and shouldn‘t be changed directly by the child components.

?

?

https://www.codevoila.com/post/55/reactjs-tutorial-state-and-props

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读