File size: 954 Bytes
1e92f2d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# Query Intro Offers
`<QueryIntroOffers />` is a React component used in managing network requests product introductory offers.
## Usage
Render the component, passing in the properties below. It does not accept any children, nor does it render any elements to the page.
```tsx
/* eslint-disable */
import QueryIntroOffers from 'calypso/components/data/query-intro-offers';
import getIntroOfferPrice from 'calypso/state/selectors/get-intro-offer-price';
const listProductPrice: React.FC = ( { siteId, productId, productPrice } ) => {
const introOfferPrice = useSelector( ( state ) =>
getIntroOfferPrice( state, productId, siteId )
);
return (
<div>
<QueryIntroOffers siteId={ siteId } />
<span>{ introOfferPrice ?? productPrice }</span>
</div>
);
};
```
## Props
### `siteId`
<table>
<tr><th>Type</th><td>Number</td></tr>
<tr><th>Required</th><td>Yes</td></tr>
</table>
The ID of the site to fetch the introductory offers for.
|