Skip to content

Instantly share code, notes, and snippets.

@y-nk
Last active March 13, 2020 04:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save y-nk/125bc7e8adcd9a156f614949a2c73453 to your computer and use it in GitHub Desktop.
Save y-nk/125bc7e8adcd9a156f614949a2c73453 to your computer and use it in GitHub Desktop.
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>)
}
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