node_modules
node_modules copied to clipboard
Function option not working
Either I'm reading the documentation wrong, or setting "function": "myFunctionName" in the options object does not change the called function from the default _jsx to myFunctionName. Below is the content of my .babelrc file:
{
"plugins": [
["babel-plugin-transform-jsx", {
"useVariables": true,
"function": "myFunctionName",
"module": "myModule"
}]
]
}
Which compiles some simple JSX such as <h1>Hello World</h1> to:
import _jsx from "myModule";
_jsx({
elementName: "h1",
attributes: {},
children: ["Hello World"]
});
I would have expected the _jsx to be renamed to myFunctionName, which does not seem to be the case.
I found the issue: you cannot use the "module" and "function" option together