- It’s a Library: React.js isn’t a framework like Angular or Vue. It’s a library focused on User Interfaces. It’s basically based on components. Currently React.js is the most popular library used in mordern Front End Devopment.
5. Data Flows from Top to Bottom: In React component, data flows from top to bottom. That means it flows from parent to child component. And if you want to pass data from parent to child component then you’ve to use props. Props are considered as HTML attributes in JSX.
6. Using State: State is one of the most important thing in dynamic data loading. And state makes the work easier for a developer. First, state is used to keep the existing value of a variable and then it can be changed based on input. And to use state, we have to call useState method. And that should have an initial value.
7. Rendering: Every state change needs the rendering. When someone changes the state, it calls the render method and that changes in Virtual DOM to show it in browser. And child components also needs to re-render because their props changed in parent component.
8. Use Linting: Using ESLint to code in React makes so many things developer friendly. It makes words different color that can easily detect and troubleshoot. Linting makes code much cleaner.
9. Use Hooks: Using hook is another masterpiece in react. Someone can easily use hooks and avoid using class. It makes coding easier and someone can make hooks by himself.
10. Conditional Rendering: Conditional rendering is one of the top notch feature of React. And Ternary operator made it more easier. Sometimes we want to render one part of the markup conditionally and we use conditional rendering. Ternary operator is one of the mostly used conditional rendering system now a days. Ternary expressions are ?(if) :(else)