4
0
forked from crowetic/commerce

Update ProductView.tsx (#433)

When you navigate to other product page, the options selected by default don't change and the options from the last product navigated are used. Adding a key to "ProductSideBar" component, makes it refresh default options and refresh actual product selected options when i navigate for many products.
This commit is contained in:
Pedro Vinícius 2021-09-23 14:44:32 -03:00 committed by GitHub
parent e991b54b0e
commit 4b58f6365a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -58,7 +58,7 @@ const ProductView: FC<ProductViewProps> = ({ product, relatedProducts }) => {
)}
</div>
<ProductSidebar product={product} className={s.sidebar} />
<ProductSidebar key={product.id} product={product} className={s.sidebar} />
</div>
<hr className="mt-7 border-accent-2" />
<section className="py-12 px-6 mb-10">