We’ll create the React component first and then look at the Vue equivalent. With the Vue 3 Composition API, you can write functional components. It’s possible also with React, but React has different templating: JSX.
With the Vue 3 Composition API, you can write functional components. It’s possible also with React, but React has different templating: JSX. What happens if we write Vue functional components with JSX templates? Are they similar to React functional components?
Let’s look at how the functional components of each of these frameworks work and how similar/different they are. The component we’ll use for this purpose is a counter, which counts clicks on a button. Additionally, it receives a limit parameter — when this limit is reached, the component notifies its parent.
We’ll create the React component first and then look at the Vue equivalent.