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

Transpiling non-exported functions? #2

Closed
niksy opened this issue May 18, 2017 · 2 comments
Closed

Transpiling non-exported functions? #2

niksy opened this issue May 18, 2017 · 2 comments
Assignees

Comments

@niksy
Copy link
Contributor

niksy commented May 18, 2017

Documentation says:

This plugin will transform all named exported arrow functions that contain JSX.

What about non-exported functions, e.g. small components defined in same file as larger component? Do you think this makes sense for transpiling, or transpiler can encounter problems with false positives?

@nickmessing
Copy link
Owner

@niksy, I think we can do that for:

const a = ({ props, listeners }) => <div onClick={listeners.click}>{props.msg}</div>

with the condition of:

  1. Defined as const
  2. Is arrow function
  3. Contains JSX

Sounds like a good idea to me

@nickmessing nickmessing self-assigned this May 18, 2017
nickmessing added a commit that referenced this issue May 26, 2017
Transpile all functions as described in #2
@nickmessing
Copy link
Owner

@niksy, done and bumped version to 2.0.0 since it's not reverse-compatible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants