-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dealing with React Fragment #31
Comments
Check this out, same issue #2 |
Consider bypassing Here is a solution:
JSXElement(path, stats) {
if (!this.hasScopedCss || path.node.openingElement.name.type === 'JSXMemberExpression') {
return
}
// let { pragmaFragIdentifier } = stats.opts;
// if (pragmaFragIdentifier && path.node.openingElement.name.name === pragmaFragIdentifier) {
// return
// }
{
"plugins": [
["babel-plugin-react-scoped-css", {
"pragmaFragIdentifier": "Fragment"
}]
]
}
Sorry to be so verbose, I'm crafting a React project boilerlate for Vue.js-camp co-workers. |
Consider a situation like this const Select = {
Fragment: () => <div>fragment</div>
}
const App = () => {
return <Select.Fragment />
} In this situation |
My idea is not to add Assuming Fragment JSX can be written in 3 forms:
Currently neither "Short syntax" nor "JSXMemberExpression syntax" will trigger the React warning mentioned above, but "Identifier syntax" like |
Adding Or maybe we can do a simple static analysis on the module to make sure |
Well it still doesn't because the plugin completely ignores any component name with dots in it |
When using 'babel-plugin-react-scoped-css' with
<Fragment>
, React gives a warning in DevTools Console:The component:
The text was updated successfully, but these errors were encountered: