infinitered / reactotron-redux

The redux plugin for reactotron that allows tracking redux actions and state
MIT License
10 stars 3 forks source link

Detect errors when redux store isn't setup. #7

Closed nhducit closed 5 years ago

nhducit commented 7 years ago

Reproduce: 1. https://github.com/reactotron/reactotron/blob/master/docs/plugin-redux.md

// ReactotronConfig.js
import { reactotronRedux } from 'reactotron-redux'

// then add it to the plugin list
Reactotron
  .configure({ name: 'React Native Demo' })
  .use(reactotronRedux()) //  <- here i am!
  1. ignore this step
    const store = Reactotron.createStore(rootReducer, compose(middleware))

Reactotron dislay error messgage:

Unable to resolve error. Either support CORS by changing webpack's devtool to "source-maps" or run in offline mode.
skellock commented 7 years ago

Do you mean, that's what you see when you try to dispatch a message from within Reactotron and you've not connected to the store?

nhducit commented 7 years ago

@skellock yup, I used createStore function from react-redux

skellock commented 7 years ago

Sure I'll put a friendly message in when you try to talk to the redux store and it's not available.

Good suggestion.

rmevans9 commented 5 years ago

Transferring this issue to the reactotron-redux repository where that code now lives

rmevans9 commented 5 years ago

I don't believe this is an issue anymore as we moved around some things in the API. If you don't add the enhancer though you will just not get any data in Reactotron. I don't believe we can detect it not being setup right since the enhancer is used AFTER you use the plugin. Closing for now as I am not sure I can do anything with this.