React 杂乱笔记

JSX produces React “elements”.

可以想像成這樣↑ 喔! 就是给了它一个物件,叫props.name = Sara

CodeSandbox這邊可以練習React,還蠻好玩的。

components defined as classes have some additional features:

1.有Local state

改寫時要注意

  1. props.xxxx要改成this.props.xxxx
再来看看这张图图。挺好玩的。

记住一句话:

  1. Class components should always call the base constructor with props.