I have no idea why, but I was getting a load of 0
's being rendered on the page. Finally I narrowed it down to a zero/0
that I wasn't forcing to be a boolean. React will not render any other digit other than 0
https://codesandbox.io/s/pyk11w5y5j
Why does 0
render but 10
for example, does not render?
function App() {
const weirdOh = -0;
const testParam = true;
return (
<div className="App">
{testParam && weirdOh && <h1>Will Show</h1>}
<h2>Start editing to see some magic happen!</h2>
</div>
);
}
Fix
{testParam && !!weirdOh && <h1>Will SHow</h1>}