react-router: this.context.router undefined in IE10
We’re currently running version 0.13.3 and are using the State Mixins to access .getParams() throughout the our app. Specifically we are calling the method in componentDidMount and componentWillReceiveProps.
When running the app in IE10, we get the error Unable to get property 'getCurrentParams' of undefined or null reference, which is being traced back to the getParams method of the State object:

I should also note that we’re using Webpack and the Babel loader.
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 17 (5 by maintainers)
I want to add that this is caused by Babel classes inheritance not entirely supported in IE<11, and can be fixed by adding an additional Babel transformer.
https://babeljs.io/docs/advanced/caveats/#classes-10-and-below-
To summarize:
getParams()
Defining
contextTypesappeared to have fixed any issues in IE10 for @coryvirok. However, it did not work for me. Instead I had to implement the params through the RouteHandler props as outlined in the docs (https://github.com/rackt/react-router/blob/v0.13.3/docs/guides/overview.md#dynamic-segments):isActive()
If you are using this method and need compatibility in IE10, you will need to implement a custom method to handle this. I decided to create a Router Utils that housed this method:
Though it’s not the best fix, it did resolve any issues with IE10. The downside to this approach is you don’t have access to the route names. Instead you have to target parts of the url. This isn’t a big issue for me since my route names and paths are consistent. An added bonus to this approach is I can check if a child route belongs to a parent route by passing in the parent route path:
I haven’t tested other methods that utilize
this.context.router, but I’m assuming you’ll run into similar issues in IE10.