https://github.com/huckleberry-inc/shopify-app-history
React router hooks for Shopify app
https://github.com/huckleberry-inc/shopify-app-history
shopify shopify-app shopify-apps shopify-polaris
Last synced: 2 months ago
JSON representation
React router hooks for Shopify app
- Host: GitHub
- URL: https://github.com/huckleberry-inc/shopify-app-history
- Owner: huckleberry-inc
- Created: 2020-05-29T08:10:44.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-07-20T05:56:51.000Z (almost 5 years ago)
- Last Synced: 2025-03-16T08:02:07.773Z (2 months ago)
- Topics: shopify, shopify-app, shopify-apps, shopify-polaris
- Language: TypeScript
- Homepage:
- Size: 808 KB
- Stars: 3
- Watchers: 18
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Welcome to @huckleberry-inc/shopify-app-history 👋

[](#)
> React router hooks for Shopify app
### 🏠 [Homepage](https://github.com/huckleberry-inc/shopify-app-history)
## Note
You can use official `linkComponent` prop if you don't expect to change Shopify App host URL.
https://polaris.shopify.com/components/structure/app-provider#using-linkcomponentIf you expect to change Shopify App host URL too, you need to call App Bridge History API.
@huckleberry-inc/shopify-app-history provides function for that.## Usage
```ts
import { useShopifyHistory } from '@huckleberry-inc/shopify-app-history';
import createApp from '@shopify/app-bridge';const app = createApp({
apiKey: 'API key from Shopify Partner Dashboard',
shopOrigin,
});// React hooks
const to = useShopifyHistory(app);// You can use it in React Component
const jump = () => { to("/another_page") }
```Also, You can check [React router API docs](https://reacttraining.com/react-router/web/guides/quick-start).
## Install
```sh
yarn add @huckleberry-inc/shopify-app-history
```## Author
👤 **Huckleberry, inc. **
## 🤝 Contributing
Contributions, issues and feature requests are welcome!
Feel free to check [issues page](https://github.com/huckleberry-inc/shopify-app-history/issues).
## Show your support
Give a ⭐️ if this project helped you!
***
_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_