Understand React component declaration vs instantiation
In React, there is a fundamental distinction between declaring a component and instantiating it. A component declaration serves as a blueprint that defines the structure and behavior of the UI. An instantiation occurs when that component is used as an element within JSX. A single component declaration can be used to create multiple independent instances of that component throughout the application.
// Component Declaration: The blueprint
function List() {
return <ul><li>Item 1</li></ul>;
}
function App() {
return (
<div>
{/* Component Instantiation: Creating multiple instances from one declaration */}
<List />
<List />
</div>
);
}