Topic-4
Topic-4
function Car(props) {
return <h2>I am a { props.brand }!</h2>;
}
return (
<div>
{isLoggedIn ? <Dashboard /> : <Login />}
</div>
);
};
5. First-Class Functions
React treats functions as first-class citizens, commonly used in event handlers and
passing functions as props.
const Button = ({ onClick }) => <button onClick={onClick}>Click me</button>;