-
-
Notifications
You must be signed in to change notification settings - Fork 225
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
JSX in function results in Unexpected JSXIdentifier #158
Comments
The first one works because it is in the global scope and is not mangled. I'm not sure why that errors in REPL. For the last case, consider this workaround for now - use |
Good to know.
I'm using EDIT: OK, found it. I'll try it later today and let you know. |
console.log(require('babel-core').transform(`
const render = () => {
const Foo = x();
return <Foo/>;
}`, {
presets: ['react', 'babili'],
passPerPreset: true
}).code); And I get the output const render = () => {
const a = x();
return React.createElement(a, null);
}; |
OK, maybe I mistyped |
This code:
Is correctly minified to:
This code:
Results with:
This occurs in Babel REPL - when I used CLI, I've received minified version of something like this:
The text was updated successfully, but these errors were encountered: