From Zero to know React — Components
Most important in React .
Component is important for React ! Why do I say ?
You can Review previous article about React
Component
- Design the Component
- Use the Component
- Component of the Component
- Component — Child and Dad information transfer
Design the Component
In React , we can use Class with ES6 , and React.Components is a Class .
If we want to create a Component , first we should extend it .
Use the component
Component of the Component
- Parent Component : Demo.jsx
- Child Component : Child.jsx
Props are read-only
We also use props to connect React’s components .
props.children
We want to determine the internal structure of the child Component in the parent Component .
props data transfer
The data only transfer between child and parents .
If you want to design a btn to create item .
How do we proccess ?
- Click Btn to trigger callback function
- Trigger Parent’s Component setState
- Parent’s Component redraw
- Change Item Props
- Item Redraw
If everybody like this article , welcome to share it and clapped (pressure can be up to 50)!
Weclome to help me like my LikeCoin Button(Logged in LikeCoin) .
My Ether Address : 0x0CC9E059BFf58a6bBe4b34c81e7f3416Af91091a
Contact Me
Hello, I am Panda .
Welcome to give me some comments or find me through the link.
Thx EveryBody !