Skip to content

Add snippets for React functional and anonymous functional components #31

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

Merged
merged 1 commit into from
Oct 11, 2018
Merged

Conversation

SeanGroff
Copy link
Contributor

@SeanGroff SeanGroff commented Oct 10, 2018

Anonymous functions are difficult to debug in the browser dev tools and React dev tools. Not having a name makes it difficult to know where the error resides.

The React Core team uses traditional named functions for functional components throughout the official documentation.

I left snippets for Anonymous and Arrow React functional components for those who prefer this style.

At the end of the day, this doesn't matter, but it'd be nice to have the option of both function Foo() {} and const Foo = () => {}

@ice-chillios
Copy link

@SeanGroff Thanks for contribution :)

@ice-chillios ice-chillios merged commit 8c2ef06 into r5n-labs:master Oct 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants