0

I'd like to integrate Redux DevTools (https://github.com/zalmoxisus/redux-devtools-extension) with ReactOnRails (https://github.com/shakacode/react_on_rails) project.

I'm not sure where I can put

window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()

as I created the store from the action in Rails itself. E.g:

redux_store('myStore', props: store_json_string)

So, where should I put the configuration for Redux in my Rails app?

Thanks in advance

4

1 回答 1

0

如果您react_on_rails使用标志运行,您可以通过在文件中--redux添加所需的行来配置它:/app/javascript/bundles/HelloWorld/store/helloWorldStore.jscreateStore

  // ...
  createStore(
    helloWorldReducer,
    railsProps,
    window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()
  )
  // ...
于 2019-01-22T06:56:42.717 回答