Yeah that's nice. React writing JS from JSX and what that means is mind bending to start with!
Just for reference you could write your return as:
returnvisible&&<h1>Hello, world</h1>
Presuming visible can only be true of false. If it could be "falsey" then:
return!!visible&&<h1>Hello, world</h1>
Also of course you could make it a wrapper around children - and then have a generic one if you prefer it to the inline syntax (and still do your delays etc)
Yeah that's nice. React writing JS from JSX and what that means is mind bending to start with!
Just for reference you could write your return as:
Presuming visible can only be true of false. If it could be "falsey" then:
Also of course you could make it a wrapper around children - and then have a generic one if you prefer it to the inline syntax (and still do your delays etc)