Ep4ReactNotes
Ep4ReactNotes
json
Npm run start and npm start same thing
npm bulid will not work we have to use npm run build becuse npm has reserved the keyword start
2. React Element
React.createElement create react object and when we render into the DOM then it will convert into
an html which we see on the browser
3. React Component
There are 2 ways of creating React component
Class Based component (Old way – uses Javascript classes)
Functional component (New way – use Javascript function)
5. Component composition
injecting component into other component
6. JSX is making our code more readable. JSX is not react
7. Component is noraml javascript function which is returing some JSX code
8. whenever we have to give inline styles we have to give it as js object in JSX.
1st curly braces tells there is some JS code inside it and 2nd curly braces tells its JS object.
13. Best practices is destructure the data then use it instead of using it directly from the props
14. we need to uniqly identify loop items so its recomended to use key attribute in all map function
If we doesn’t add ke react has to render all ites again becuase it doesn’t identify all the items again