alexfinnarn / swole-nation-react-native

Make America Swole Again...more quickly this time...
MIT License
0 stars 0 forks source link

Refactor Higher-Order Components To Use Hooks Instead #190

Open alexfinnarn opened 5 years ago

alexfinnarn commented 5 years ago

I completely missed the point of React's Hooks allowing you to eliminate the need for Higher-Order Components and render item props.

https://reactjs.org/docs/hooks-faq.html#do-hooks-replace-render-props-and-higher-order-components https://react-redux.js.org/api/hooks

I should be able to remove the Provider components and make the app less complex with less passed down data. However, then the presentational components know about Redux and the store when they didn't before. I should probably do this anyway to fit in with the Hooks paradigm.

Make sure to turn into a blog post.

alexfinnarn commented 4 years ago

I can still use Redux with hooks https://react-redux.js.org/api/hooks but maybe its best to drop Redux entirely. Luckily, the API is so small it won't even matter much how I hook up the store to the rest of the components.