Skip to content
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

babel-plugin-transform-es2015-arrow-functions bug (T7215) #4182

Closed
babel-bot opened this issue Mar 16, 2016 · 5 comments
Closed

babel-plugin-transform-es2015-arrow-functions bug (T7215) #4182

babel-bot opened this issue Mar 16, 2016 · 5 comments
Labels
i: bug outdated A closed issue/PR that is archived due to age. Recommended to make a new issue

Comments

@babel-bot
Copy link
Collaborator

Issue originally made by @jprichardson

Bug information

  • Babel version: 6.x
  • Node version: 5.3.0
  • npm version: 3.7.1

Input code

export default (onClick) => (<div onClick={ () => onClick(text) } ></div>);

Description

You'll notice an export at the bottom that didn't get transpiled.

Sorry, regarding Babel "version", wasn't sure which version to put since there are so many libraries. I'm using babel-plugin-transform-es2015-arrow-functions@6.5.2.

@babel-bot
Copy link
Collaborator Author

Comment originally made by @loganfsmyth

#3433

@babel-bot
Copy link
Collaborator Author

Comment originally made by @loganfsmyth

The fix for this ended up introducing a separate bug (https://phabricator.babeljs.io/T7272), so we've rolled this back for now. Will re-evaluate the best fix.

@id-ilych
Copy link

It works if there's explicit declaration and then export

const Link = ({ onClick }) => {
  return <div onClick={() => onClick()}></div>;
}

export default Link;

@danez
Copy link
Member

danez commented Sep 19, 2016

@danharper already created a PR with a fix in #4524 🎉
but meanwhile you might need to use this workaround.

@hzoo hzoo added the i: bug label Sep 19, 2016
@hzoo
Copy link
Member

hzoo commented Sep 20, 2016

Fix in #4524, will release this week

@hzoo hzoo closed this as completed Sep 20, 2016
@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label May 6, 2018
@lock lock bot locked as resolved and limited conversation to collaborators May 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
i: bug outdated A closed issue/PR that is archived due to age. Recommended to make a new issue
Projects
None yet
Development

No branches or pull requests

4 participants