K
K
kova1ev2019-05-03 11:05:19
JavaScript
kova1ev, 2019-05-03 11:05:19

Application on react + redux + react-dnd doesn't work after build, why?

when running the test script, I get the error
Invariant Violation: Could not find "store" in the context of "Connect(DragD
ropContext(App))". Either wrap the root component in a ,
or pass a custom React context provider to and the
corresponding React context consumer to Connect(DragDropContext(App)) in connect options.
although in an unbuilt project everything works. As I understand it, there are some problems due to the fact that the root component is wrapped in two hoc - one redux, the other dnd.

ReactDOM.render(<DragDropContextProvider backend={HTML5Backend}>
                    <Provider store={store}>
                        <App />
                    </Provider>
                </DragDropContextProvider>, document.getElementById('root'));

I tried wrapping first in dnd, then in redax - it didn’t help, everything is the same.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question