form jQuery:
<div class="bingo">
<button>Say hi!</button>
</div>
<script>
$('button').on('click', function () {
console.log('hi')
})
</script>
to Vue:
<template>
<div class="bingo">
<button @click="handleClick">Say hi!</button>
</div>
</template>
<script>
export default {
methods: {
handleClick() {
console.log('hi')
}
}
}
</script>
to React:
class Bingo extends Component {
handleClick() {
console.log('hi')
}
render() {
return (
<div class="bingo">
<button onClick={this.handleClick}>Say hi!</button>
</div>
)
}
}
I will make the Vue version first, let's see how long it takes in order to make the plan for React version.