Invariant Violation: Could not find “store” in either the context or props of “Connect(SportsDatabase)”

后端 未结 9 1763
别那么骄傲
别那么骄傲 2020-12-12 10:36

Full code here: https://gist.github.com/js08/0ec3d70dfda76d7e9fb4

Hi,

  • I have an application where it shows different templates for desktop and mobile
9条回答
  •  佛祖请我去吃肉
    2020-12-12 11:08

    in my case just

    const myReducers = combineReducers({
      user: UserReducer
    });
    
    const store: any = createStore(
      myReducers,
      applyMiddleware(thunk)
    );
    

    shallow(, { context: { store } });

提交回复
热议问题