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

Using arrow function in react components attribute break export (T7469) #4377

Closed
babel-bot opened this issue Jun 29, 2016 · 3 comments
Closed
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 Арсен С (NuArsen)

Bug information

Input code

Not working:

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

Working:

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

Description

Code with arrow function inside react component attribute not exporting component. Issue repeats in https://babeljs.io/repl/

@babel-bot
Copy link
Collaborator Author

Comment originally made by Арсен С (NuArsen)

Any feedback?

@hzoo hzoo added the i: bug label Sep 10, 2016
@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

Thanks, duplicate of #4182.

@danez danez closed this as completed Sep 19, 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