usePDP
The usePDP
hook allows you to access pdp data and perform mutations that will reflect on other entities within the Sales App data layer.
Usage
import { usePDP } from '@vtex/sales-app'
const Product= () => { const { productSku } = usePDP()
return <div>Product name: {productSku?.name}</div>}
Parameters
The usePDP
hook does not receive any parameters.
Returns
The usePDP
hook returns an object with the following properties:
productSku
- type
ProductSku
Extension Points
This hook is available in the following extension points:
pdp.sidebar.before
pdp.sidebar.after
pdp.content.after
For a full list of available extension points, refer to the ExtensionPoints page.