huckleberry-inc / shopify-app-history

React router hooks for Shopify app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Welcome to @huckleberry-inc/shopify-app-history πŸ‘‹

Version License: MIT build

React router hooks for Shopify app

🏠 Homepage

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-linkcomponent

If 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

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.

Install

yarn add @huckleberry-inc/shopify-app-history

Author

πŸ‘€ Huckleberry, inc. dev@huckleberry-inc.com

🀝 Contributing

Contributions, issues and feature requests are welcome!

Feel free to check issues page.

Show your support

Give a ⭐️ if this project helped you!


This README was generated with ❀️ by readme-md-generator

About

React router hooks for Shopify app


Languages

Language:TypeScript 80.9%Language:JavaScript 19.1%