Reactjs Notes
Reactjs Notes
jsx)
What is JSX ?
It is combination of javascript and XML (xtensible markup language).
*follow camelCase.
folder Structure:
Component
Types of components.
FBC CBC
For example
<Child1 data=”world”/>
<Child data=”galaxy”/>
Props(Properties)
-Props are inbuilt Objects.
-Props are used to pass the data from parent component to child component.
-props are immutable.
States
To create a dynamic data.
States are mutable.
States belong to only one component are local.
FBC are Stateless components to make this component statefull we use hooks.
KEYS
Keys are used to identify the unique elements of the html.
Key is an attribute.
MODULE----
1. Simple
2. Combinator
1. Descendent(“ ”)
2. Child(“>”)-------->target only child
3. Adjacent-sibling(“+”)-------------->target only nearest one
4. General sibling(“ ~ ”)-------------->target all after the section tag
Ref
Form-Handling
1) UNCONTROLLED FORMS(Ref).
2) CONTROLLED FORMS(States).
Uncontrolled forms:
* These forms are directly handled by real dom ,the data whichever user enters it
is completely handled by real dom
*These forms are created using ref (reference) which targets real dom
*It is completely disadvantages to use these forms