Last active
March 13, 2020 04:50
-
-
Save y-nk/125bc7e8adcd9a156f614949a2c73453 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 = ({ show }) => (show ? <div>shown!</div> : null) | |
const App = (props) => { | |
const [toggle, setToggle] = useState(true) | |
return (<div> | |
<button onClick={() => setToggle(!toggle)}>click me</div> | |
<BadGoose show={toggle} /> | |
</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 = { | |
props: ['show'], | |
template: '<div v-if="show">shown!</div>', | |
} | |
const App = { | |
components: { BadGoose }, | |
template: `<div> | |
<button @click="toggle = !toggle">click me</button> | |
<bad-goose :show="toggle" /> | |
</div>`, | |
data: () => ({ toggle: true }) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment