Last active
March 13, 2020 04:50
-
-
Save y-nk/54fc14a8f4e3d485708685f820f87744 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const BadGoose = () => (<div>shown!</div>) | |
const App = (props) => { | |
const [toggle, setToggle] = useState(true) | |
return (<div> | |
<button onClick={() => setToggle(!toggle)}>click me</div> | |
{ toggle ? <BadGoose /> : null } | |
</div>) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const BadGoose = { | |
template: '<div>shown!</div>', | |
} | |
const App = { | |
components: { BadGoose }, | |
template: `<div> | |
<button @click="toggle = !toggle">click me</button> | |
<bad-goose v-if="toggle" /> | |
</div>`, | |
data: () => ({ toggle: true }) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment