DEV Community

adarvin14
adarvin14

Posted on

How State Works in React

React has become one of the most commonly used languages to code with in web development. One unique aspect of it is the ability to have a state: a Javascript object that updates a component's dynamic data. However, state can only work within a class component, which is why when functional components are used, they are usually designed for rendering static data like footers or a navigation bar. In other words, data that is written into components that do not use state are not subject to change. Since the data is not being manipulated in any way, state is not required for that component.

Top comments (0)