0

I'm confused by issue caused by react-router-dom. It can't import matchPath function from react-router. Exception is:

./node_modules/connected-react-router/esm/selectors.js Attempted import error: 'matchPath' is not exported from 'react-router'.

  • there is no such a thing as `matchPath` in react router. `match` and `history` are part of the props passed to component if you have wrapped your app with Routes – Amir-Mousavi Jan 09 '19 at 09:53

1 Answers1

0

matchPath was added to react-router sometime after V3.2.1 and before V4.3.1. Check which version you have with:

npm list react-router

If it's an older (v3) than update it with:

npm update react-router
jdh
  • 1,637
  • 14
  • 12