react-redux-toastr: Cannot read property 'confirm' of undefined

I have the following in App.js

<Provider store={store}>
        <div>
          <ReduxToastr />
          <Router history={hashHistory}>
            <Route path='/admin' component={Comp1}>
              {/* some components here*/}
            </Route>
            <Route path="/" component={Comp2}>
            {/* some components here*/}
          </Router>
        </div>
      </Provider>

I can not even start the app because I keep getting a “Cannot read property ‘confirm’ of undefined” error from the ReduxToastr component

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 26 (14 by maintainers)

Most upvoted comments

Hello, this is an old post but I’ve just installed the latest versions of react-redux-toastr and I’m getting the exact same error. I’m using the react boilerplate from https://github.com/react-boilerplate/react-boilerplate

@nicomfe thanks and sorry for the late reply.

I created a pull request #20 with a not that fancy solution, but solves the problem of immutable states

@diegoddox not right now 😦. I’ll give it a try later, Thanks anyway

Now, the app does not crash. The toastr/ADD action is fired and the toastrs array updated accordingly but the message never shows up. Really odd

Ok, @diegoddox , I’ll give it a try and let you know. Thanks

@pepesenaris have you add the toastr reducer?

import {reducer as toastrReducer} from './toastr';
export default combineReducers({
  // others...
  toastr: toastrReducer
});