I'd like to conditionally render a React component like this:
parent.ts
...
<Parent>
<Child/>
<Parent>
...
child.ts
...
return (someBoolean && <Component/>)
...
I get a TypeScript error in child.ts that Its return type 'false | Element' is not a valid JSX element.
I want the conditional to be in child.ts, because it is used in other places as well, not just parent.ts. What's the appropriate way to do this? Would I have to settle for a ternary or if/else?