Re:TypeScript Is Surprisingly OK for Compilers
by doctormanhatten on Friday August 18, 2023 @06:13AM
(#37173595)
Having written quite a lot of Reason react (similar in syntax to the proposed React example) - while in this particular case because the example is so simple the ternary looks nicer, its also nice to just have a longer expression block in the middle of your JSX when you're doing more complex things.
And the React example makes no sense, you can use a ternary and it is even shorter.
``` return ( <nav> <Home /> {loggedIn ? <LogoutButton /> : <LoginButton /> } </nav> ) ```