Props
RE · Componentssyntax
function Component({ propA, propB }) { ... }
// or
function Component(props) {
const { propA, propB } = props;
}example
function UserCard({ username, role, isActive }) {
return (
<div>
<strong>{username}</strong>
<span>{role}</span>
{isActive && <span>Online</span>}
</div>
);
}output
Renders the user card with username, role, and optional online badge.Note Props are read-only. Never mutate a prop directly inside a component. Destructuring in the parameter list is the most common pattern.