simon-rad / react-router-props

React router shape and location shape for react-router props
6 stars 1 forks source link

Transpile ES6 statements #1

Open mhuggins opened 6 years ago

mhuggins commented 6 years ago

Thanks for this package! It's great, except that it only works where ES6 syntax is supported. It would be great if it could have a transpiled version that was published to npm.

freak3dot commented 6 years ago

mhuggins is correct. This doesn't work in IE11.

Specifically, this throws an error:

export default {
  locationShape,
  matchShape,
  historyShape,
};

It would work like this:

export default {
  locationShape: locationShape,
  matchShape: matchShape,
  historyShape: historyShape,
};

You can do this and more if you provide a transpiled version as mhuggins suggests.

I've switched to react-router-prop-types instead to work around this issue. https://www.npmjs.com/package/react-router-prop-types