Skip to content

Commit

Permalink
Merge branch 'fix/W-11935976' of github.com:bfeister/pwa-kit into fix…
Browse files Browse the repository at this point in the history
…/W-11935976

* 'fix/W-11935976' of github.com:bfeister/pwa-kit:
  Revert "Remove custom options for react query hoc (SalesforceCommerceCloud#755)" (SalesforceCommerceCloud#775)
  Footer copyright: remove the remaining hardcoded year (SalesforceCommerceCloud#760)
  Shopper promotions hooks (SalesforceCommerceCloud#759)
  Dynamic footer Copyright date (SalesforceCommerceCloud#741)
  [commerce-sdk-react] Add mutation hooks and refactor query hooks (SalesforceCommerceCloud#726)
  • Loading branch information
bfeister committed Oct 20, 2022
2 parents 852e789 + 0f01f65 commit ec5b66c
Show file tree
Hide file tree
Showing 77 changed files with 1,465 additions and 633 deletions.
21 changes: 18 additions & 3 deletions packages/commerce-sdk-react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ A library of React hooks for fetching data from Salesforce B2C Commerce.

The full documentation for PWA Kit and Managed Runtime is hosted on the [Salesforce Developers](https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/overview) portal.


## PWA-Kit Integration

> To integration this library with your PWA-Kit application you can use the `CommerceApiProvider` directly given that you use the `withReactQuery` higher order component to wrap your `AppConfig` component. Below is a snippet of how this is accomplished.
Expand All @@ -21,9 +22,24 @@ const AppConfig = ({children}) => {
{children}
</CommerceApiProvider>
)
}
// Set configuration options for react query.
// NOTE: This configuration will be used both on the server-side and client-side.
const options = {
queryClientConfig: {
defaultOptions: {
queries: {
retry: false
},
mutations: {
retry: false
}
}
}
}
export default withReactQuery(AppConfig)
export default withReactQuery(AppConfig, options)
```

## Generic Integration
Expand All @@ -44,11 +60,10 @@ const App = ({children}) => {
</CommerceApiProvider>
</QueryClientProvider>
)
}
}
export default App
```

### Useful Links:

- [Get Started](https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/getting-started.html)
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ec5b66c

Please sign in to comment.