Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Warning when wrapping router #20

@ndevvy

Description

@ndevvy

I'm setting up Opbeat with my React app and get a console warning when I patch my router using wrapRouter per the setup instructions:

Warning: [react-router] `Router` no longer defaults the history prop to hash history. Please use the `hashHistory` singleton instead.

React also fails to render anything when using the wrapped router.

I'm using browserHistory; here is my relevant code (initOpbeat is called earlier, from a separate initializers file):

import React, { Component } from 'react';
import { Provider } from 'react-redux';
import DashboardRoutes from './DashboardRoutes';
import store from './RootStore';
import { wrapRouter } from 'opbeat-react';
import { Router, browserHistory } from 'react-router';
const OpbeatRouter = wrapRouter(Router);

export default class Root extends Component {
  render() {
    return (
      <Provider store={store}>
        <OpbeatRouter history={browserHistory}>{DashboardRoutes}</OpbeatRouter>
      </Provider>
    );
  }
}

Any guidance on this would be appreciated. I'm using react-router 2.8.1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions