We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No response
hydrogen-react
^2024.1.1
Update data and initialVariantId to a different product and variant.
data
initialVariantId
export default function Product({ data, initialVariantId }) { return ( <ProductProvider data={data} initialVariantId={initialVariantId}> <ProductTest /> </ProductProvider> ); } function ProductTest() { const { product, selectedVariant } = useProduct(); console.log(product.title, selectedVariant.title); return ( <div> {product.title} {selectedVariant.title} </div> ); }
Using an apparel store as example I would expect the following behaviour:
console.log
T-Shirt Black / XL
Sweatshirt Red / XS
The actual behaviour carries over the selectedOptions to the new product data like this:
selectedOptions
Sweatshirt Black / XL
The text was updated successfully, but these errors were encountered:
I think this will depends on how you are changing the data and initialVariantId Can you provide more information about that?
Sorry, something went wrong.
No branches or pull requests
What is the location of your example repository?
No response
Which package or tool is having this issue?
hydrogen-react
What version of that package or tool are you using?
^2024.1.1
What version of Remix are you using?
No response
Steps to Reproduce
Update
data
andinitialVariantId
to a different product and variant.Expected Behavior
Using an apparel store as example I would expect the following behaviour:
data
and black / XLinitialVariantId
console.log
outputsT-Shirt Black / XL
data
prop to "sweatshirt" product data and red / XSinitialVariantId
console.log
outputsSweatshirt Red / XS
Actual Behavior
The actual behaviour carries over the
selectedOptions
to the new productdata
like this:data
and black / XLinitialVariantId
console.log
outputsT-Shirt Black / XL
data
prop to "sweatshirt" product data and red / XSinitialVariantId
console.log
outputsSweatshirt Black / XL
(provided the product has options with the same name and value available)console.log
outputsSweatshirt Red / XS
The text was updated successfully, but these errors were encountered: