Junior — Middle
What is the difference between a component's properties and its internal state?
sobes.tech AI
Answer from AI
Component properties (props) are input data passed into the component from outside and are usually not modified by the component itself. They allow configuring the behavior or display of the component.
Internal state (state) is data that the component stores and can change independently during its operation. Changing the state typically results in the component re-rendering.
Example: in a React component, props can set the initial text, while state stores the current text, which changes upon user interaction.