← React Intermediate Questions - Set 2 Q12

How do you handle conditional rendering in React?

React Intermediate Questions - Set 2

Example

{isLoading && <Spinner />}
{error ? <Error msg={error} /> : <List items={items} />}
if (!user) return <Login />;

What to notice

← Back to the question list