Open enkelmedia opened 3 years ago
Doesn't every usage of this.props.client
need to be changed to just client
now that the constant is defined?
I don't really understand how this fixes the issue though 🤔
The prop should exist: https://github.com/Shopify/storefront-api-examples/blob/ea24cff64152578a347695072cb41ba268c6662c/react-graphql-client/src/index.js#L18
Plus const client = this.props.client;
implies it does exist
I just started the Example site with npm run start, got the error, added this code and it worked. I haven’t spent a lot of time looking at why.
Might be more places where something similar is needed, might be a build-confit issue - I don’t know but this made the “add to cart” work which at least made the example useful.
Edit: I’m sure that the prop exists but one can’t just use the name of the prop, the code I’ve added creates a variable, it would probably work to just prepend this.props to the client variable usage.
Solves issue #109 by adding client varible.