liftedpixel / jammming

a Codecademy React project
http://jammmmmmmmmmmming.surge.sh
0 stars 0 forks source link

Stateless functional components #5

Open ghost opened 7 years ago

ghost commented 7 years ago

https://github.com/liftedpixel/jammming/blob/master/src/components/SearchResults/SearchResults.js

The class syntax is the standard way to define a React component. But it's kind of a lot of ritual for a component that doesn't refer to this.state and only has a render() function.

In these situations, it's often preferable to write your component as a stateless functional component rather than a full blown component using class.

https://facebook.github.io/react/docs/components-and-props.html

liftedpixel commented 7 years ago

well, actually i just broke a bunch of stuff so reopening