JSX Functional Components for Vue JSX
This babel plugin adds some syntactic sugar to JSX.
Usage:
npm i babel-plugin-jsx-vue-functional -D
or
yarn add babel-plugin-jsx-vue-functional -D
Then add jsx-vue-functional
to your .babelrc
file under plugins
example .babelrc:
Example:
const A = <h1>Hello World</h1>const B = <div onClick=listenersclick>propsmsg<A /></div>
will be transpiled into:
const A = functional: true <h1>Hello World</h1> const B = functional: true <div onClick=listenersclick>propsmsg<A /></div>
Warning
This plugin will transform all named arrow functions that contain JSX and starting with version 2.0.0 so this code will not work:
const A = <h1>Hello World</h1>const B = <div onClick=listenersclick>propsmsg</div>