React summery after 3 weeks studying.

Abinash Panda
2 min readDec 31, 2019
  1. It is a JavaScript library.
  2. declarative: that means we have to write what to display rather than how to display.
  3. component-based: that’s why we can break an app into a reusable, independent smaller component.
  4. After learning to react we can use to develop native mobile apps, desktop apps, and CLI tools and we can render serverside through nodejs.
  5. JSX means JavaScript XML we well use to write react elements and its syntax is very similar to HTML. Every Jsx element needs to close and every element can be a self-closing tag. JSX is also an expression.
  6. You can put any valid JavaScript expression inside JSXand you have to wrap inside { } curly brackets.
  7. We gave id ‘root’ to an Html tag inside the body and that root tag is managed by React. ‘Ex. ReactDOM.render(element, document.getElementById(‘root’) );’
  8. React elements are immutable. Once you create an element, you can’t change its children or attributes.
  9. React don’t reload the whole page instead of its only change what is necessary.
  10. Function components are stateless and class components are stateful that’s why we can only save state in class components.
  11. There are multiple ways to handle an event
  12. Conditional rendering is very similar to ‘if’ ‘else’ or ternary operator JavaScript but inside we have our React element or React Module.
  13. We can use JavaScript logical operators like ‘&&’, ‘||’.
  14. A “key” is a special string attribute you need to include when creating lists of elements.
  15. The component can receive an object from his parent component we called it props.
  16. In React, a mutable state is typically kept in the state property of components and only updated with setState().
  17. Form maintains its own state and updates based on user input.
  18. In React, changeable components kept inside state property and we can only update it with SetState() and it takes an {} as a parameter.
  19. When we need to send data to its sibling components we lift our state up.
  20. Composition and inheritance are the approaches to use multiple components together in React.js. This helps in code reuse.
  21. You can write the expression in between {}
  22. Props used to send one component to another. And props are read-only.
  23. You can change the state. When state change components re-render.
  24. In React Data flows at unidirectional that is upwards.
  25. In React we break an app into smaller components and in the end, we have only one component which contains other child components.

--

--