What will be the output of the following code?
{
condition1 ? <Component1 /> :
condition2 ? <Component2 /> :
<DefaultComponent />
}
It will render <Component1 /> if condition1 is true, otherwise <Component2 /> if condition2 is true, otherwise <DefaultComponent />
It will render <Component1 /> if condition1 is true, otherwise <Component2 />.
It will always render <Component1 />
It will never render anything.
This question is part of this quiz :
Conditional Rendering In React