React | Conditional Rendering | Question 7

Last Updated :
Discuss
Comments

In the following code, what will be rendered?

JavaScript
const userRole = 'admin';
return userRole === 'admin' && <AdminPanel/>;

null

undefined

<AdminPanel />

An error will occur

Share your thoughts in the comments