Open ghost opened 7 years ago
I changed to a function but kept getting an error. Then I re-read the article you linked and I needed to remove "this" from the {this.props.searchResults) in the TrackList component instance. Thanks again for your feedback and tips.
https://github.com/ozbo1973/bwa-u3-jammming-prj/blob/master/Jamming-Review/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 tothis.state
and only has arender()
function.In these situations, it's often preferable to write your component as a
stateless functional component
rather than a full blown component usingclass
.https://facebook.github.io/react/docs/components-and-props.html