Closed johnthepink closed 7 years ago
Completely agree. I have a few 'in progress' components I was about to add state to. That's when I ran off to take a look at Redux.
I do have a couple examples of stateless. And intend to follow the pattern as you mentioned.
some examples... Components Filter (currently doesn't have state, was in process of adding) LocationMap (has lifecycle function, was in process of adding state) Marker (used PureComponent, per recommendation of google map package provider)
Stateless Components Navbar Sidebar
I'm not sure you have come across these yet, but Stateless Components in React allow you to write components as just regular javascript functions if they are purely presentational (meaning if they do not require lifecycle functions).
For example:
...could be re-written as:
...and you could take it even a step further, because the airbnb lint defaults will yell at you about those curly brackets and then only a return statement: