babel-plugin-transform-vue-jsx
babel-plugin-transform-vue-jsx copied to clipboard
flow.js: Cannot resolve name React
I'm using Flow with Vue and if I have a jsx template, I get an error.
Here is the code:
// @flow
export default {
render (h: any) {
return <section />
}
}
The error is:
5:12 error Cannot resolve name
Reactflowtype-errors/show-errors
I can fix it if by putting // @jsx h on the top of the file - but this solution is not ideal.
I did some research and @babel/plugin-transform-react-jsx supports pragmas in the babel.config.js like this:
{
"plugins": [
["@babel/plugin-transform-react-jsx", {
"pragma": "h"
}]
]
}
And TypeScript seems to support similar pragmas in the .tsconfig.
Any way to fix it in Vue?