Skip to content

Instantly share code, notes, and snippets.

Avatar

Yookyun James Chung vanilla-james

View GitHub Profile
@mjackson
mjackson / nested-ternary-jsx.js
Created Nov 2, 2016
Nested ternaries work like if/else if/else for JSX
View nested-ternary-jsx.js
const element = (
<div>
{currentPage === 'signin' ? (
<SignInPage/>
) : currentPage === 'welcome' ? (
<WelcomePage/>
) : currentPage === 'about' ? (
<AboutPage/>
) : (
<DefaultPage/>