Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
March 28, 2022 08:46 am GMT

React, Vue and Svelte: Comparing the basics - Part 7

Click Event in...

The use of the click directive is quite similar in these 3 frameworks.

Check it out

React

Link

const handleClick = () => {  alert('I was clicked!')}<button  onClick={handleClick}  className="button">Click me!</button>

Vue

Link

const handleClick = () => {  alert('I was clicked!')}<button  @click="handleClick"  class="button">Click me!</button>

Svelte

Link

const handleClick = () => {  alert('I was clicked!')}<button  on:click={handleClick}  class="button">Click me!</button>

Original Link: https://dev.to/ccreusat/react-vue-and-svelte-comparing-the-basics-part-7-1m1p

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To