polaris-reach-link
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

polaris-reach-link

A <Link /> between @reach/router and @shopify/polaris

TL;DR

import { AppProvider } from '@shopify/polaris';
import { Link } from 'polaris-reach-link';
import en from '@shopify/polaris/locales/en.json';
 
 
function App() {
  return (
    <AppProvider linkComponent={Link} i18n={en}>
      <MyApp />
    </AppProvider>
  );
}

About

This package provides a compatiblity layer between @shopify/polaris and @reach/router. It should basically be set and forget. For all other linking needs just use the Link component from @reach/router directly

Installation

npm install polaris-reach-link

or

yarn add polaris-reach-link

You will also need to have @shopify/polaris and @reach/router installed seperately

Setup

Pass the Link from this package to your AppProvider component on the linkComponent prop (see above)

Further considerations

If you are using this in an embedded app, consider also using @shopify/react-shopify-app-route-propagator to keep the parent windows url in sync with your app

Contributing

PRs are welcome

Licence

MIT - See ./LICENCE

Package Sidebar

Install

npm i polaris-reach-link

Weekly Downloads

0

Version

0.2.0

License

MIT

Unpacked Size

11.7 kB

Total Files

12

Last publish

Collaborators

  • qw-in