Shopify / storefront-api-examples

Example custom storefront applications built on Shopify's Storefront API
https://help.shopify.com/api/storefront-api
MIT License
1.12k stars 329 forks source link

new react example with react hooks #90

Open awongh opened 5 years ago

awongh commented 5 years ago

I created a working example of the react-js-buy example with the new react hooks syntax.

React is moving away from component classes in 16.8.1

Context: https://reactjs.org/docs/hooks-intro.html

Thanks :)

swalkinshaw commented 5 years ago

This is pretty awesome, thanks. But maybe we should make this a new example instead of modifying the old one? It could be called react-hooks-js-buy-sdk? Hooks are brand new so I'm wary of just replacing the existing one.

awongh commented 5 years ago

Yea, I can definitely do that.

Unless you want to just leave the pull request open just for other's reference. At some time in the future the non-component class syntax for react will become the standard, I assume?

swalkinshaw commented 5 years ago

Up to you 😄 But yeah I assume it will become the standard at some point.