AbhayVel / yogesh911

0 stars 0 forks source link

what is state in react? #38

Open YogeshG85 opened 1 year ago

YogeshG85 commented 1 year ago

In React, "state" is an object that holds data which can be used to determine the behavior of a component and its children. Unlike props, which are passed from a parent to a child component, state is managed within a component and can be updated by that component or its children.

You can initialize state in a React component by setting the state property in the component's constructor method.