Skip to content

Instantly share code, notes, and snippets.

@devsumanmdn
Created June 17, 2018 06:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devsumanmdn/e1018cb9f852bab0cf87eca5657293c6 to your computer and use it in GitHub Desktop.
Save devsumanmdn/e1018cb9f852bab0cf87eca5657293c6 to your computer and use it in GitHub Desktop.
What's the best way to define a functional stateless Component in react?
// Consider these two ways to define a functional stateless Component in react,
// which one is better and why?
// Or can suggest better also
//-----------------------------------------------------------------------------
// way 1
const ComponentName = (props) => {
return (
// Your JSX
);
};
// way 2
function ComponentName(props) {
return (
// Your JSX
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment