React Redux関連のエラーとそれに対するコメント
React-redux
error message
Uncaught TypeError: (0 , _redux2.default) is not a function
typo
be careful to use {} and ‘’ to import modules
No reducer provided for key
React-Redux - No reducer provided for key
combinereducer is not a function
after deleting node_modules and installing again, the error message is gone.
combinereducers Module build failed: SyntaxError: Unexpected character ‘'
this was considered as a cause from webpack but, actually in my case, I didn’t pass props and state correctly since i started to use mapstatetoprops.
to pass the state and props correctly, i needed to pass state from each reducers in mapstatetoprops function since each reducers have default states
combineReducers not working
this problem happened from combined reducer since I didn’t understand correctly how to use combine reducers function
Uncaught Error: Module build failed: SyntaxError: Unexpected character ‘'
this problem was solved after typing combinereducers function by hand.
otherwise, my linter didn’t detect the code correctly.
I picked up the combine reducer code example from here.
https://redux.js.org/basics/example-todo-list#reducers-index-js
rootreducer test cases example
https://github.com/reduxjs/redux/issues/1412
Came across this error messages when writing unit test cases
Invariant Violation: Could not find "store" in either the context or props of "Connect(Cards)". Either wrap the root component in a <Provider>, or explicitly pass "store" as a prop to "Connect(Cards)”.
Invariant Violation: Element type is invalid: expected astring (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in. Check the render method of `WrapperComponent`.