Actions must be plain objects. Use custom middleware for async actions. ❯ dispatch node_modules/redux-mock-store/lib/index.js:41:19
useEffect(() => {
dispatch(fetch({ url }))
^
}, [url, reload])
Using vitejs and redux-mock-store it should mock redux dispatch function
I forgot add middleware with redux-thunk.
import thunk from 'redux-thunk'//...
const middlewares = [thunk]const mockStore = configureStore(middlewares);//...
ref: https://github.com/reduxjs/redux-mock-store#asynchronous-actions