Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Support for React Reach Router #42

Open
dpiessens opened this issue Mar 12, 2019 · 3 comments
Open

Support for React Reach Router #42

dpiessens opened this issue Mar 12, 2019 · 3 comments
Labels
enhancement New feature or request

Comments

@dpiessens
Copy link

We're using the Reach Router instead of the react router. Our routing is simple and reach meeting some specific needs we have. This however causes messurite-react to fail even if we don't use the withMezzuriteRouter(). It looks like the wrapper could work with Reach, but I'm not sure how to make the core import optional and not fail.

@baresj baresj added the enhancement New feature or request label Mar 12, 2019
@brrusino
Copy link
Contributor

It looks like Reach exposes LocationProvider, which sets up a listener to location changes. This could be extended to capture ALT start/VLT end similar to withMezzuriteRouter - want to give that a try? Also regarding the failures you're seeing without withMezzuriteRouter implemented, can you post the error you're seeing in the console?

@dpiessens
Copy link
Author

Sure I can give that a try.

Here's the error when I just wrapped one of my components without the router annotated:
ERROR in ./node_modules/@microsoft/mezzurite-react/esm/mezzurite-react.js Module not found: Error: Can't resolve 'react-router' in 'C:\Projects\reveal\client\Reveal.UI.Web\client\node_modules\@microsoft\mezzurite-react\esm' @ ./node_modules/@microsoft/mezzurite-react/esm/mezzurite-react.js 5:0-42 212:11-21 @ ./app/workitems/components/WorkItemsListView/WorkItemsListView.jsx @ ./app/workitems/containers/WorkItemsListView/WorkItemsListView.jsx @ ./app/common/containers/App/App.jsx @ ./app/index.jsx @ multi webpack-hot-middleware/client @babel/polyfill whatwg-fetch ./app/index.jsx

All I did for the component was:
import {withMezzurite} from '@microsoft/mezzurite-react'; ... export default withMezzurite(WorkItemsListView);

@brrusino
Copy link
Contributor

Just opened bug #43 to track this issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants