context API: The Context API is a React structure that enables you to exchange unique details and assists in solving prop-drilling from all levels of your application.
Only call Hooks at the top level. Don't call Hooks inside loops, conditions, or nested functions.
State-props: Props are used to pass data, whereas state is for managing data. Data from props is read-only, and cannot be modified by a component that is receiving it from outside. State data can be modified by its own component.
What is the use of PropTypes?
PropTypes are a mechanism to ensure that components use the correct data type and pass the right data, and that components use the right type of props, and that receiving components receive the right type of props.
Performance Optimization Techniques for React Apps
- Using Immutable Data Structures.
- Function/Stateless Components and React.
- Multiple Chunk Files.
- Use React.
- Avoid Inline Function Definition in the Render Function.
- Avoid using Index as Key for map.
Global variables are those declared outside of a block
Local variables are those declared insides of a block
Top comments (0)