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

react stateless functional component snippet #17

Closed
audiolion opened this issue Jun 8, 2018 · 3 comments
Closed

react stateless functional component snippet #17

audiolion opened this issue Jun 8, 2018 · 3 comments

Comments

@audiolion
Copy link

Would you be adverse to adding the non fat arrow syntax version of a stateless functional component?

function $1(props) {
  return (
    <div>$2</div>
  );
}

export default $1

I ask because flow recommends this style

@chillios-dev
Copy link

Hi @audiolion, I'm not a very big fan of writing function word nowadays in JS. We have Babel, and other stages to transpile arrow functions. However, if we figure out how to name those you can create a PR :) I thought about pfc -> pureFunctionComponent and so on. What do you think?

@audiolion
Copy link
Author

Yeah @dsznajder I don't too much either, but it is a valid way and if some codebases have opinions about styling functions then perhaps this would be useful. I suppose we could wait to see if some other people would vote 👍 on whether they would want this and if adding another keyword is worth it

@chillios-dev
Copy link

I will add it anyway, it does not crash anything. Will be in next release :)

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