function FunctionComponent() {
const [state, dispatchers] = useModel('counter');
return
{state}
;
}
<!--
Your bug will get fixed much faster if we can run your code and it doesn't
have dependencies other than @ice/store. Issues without reproduction steps or
code examples may be immediately closed as not actionable.
-->
Link to code example:
<!--
Please provide a CodeSandbox (https://codesandbox.io/s/new), a link to a
repository on GitHub, or provide a minimal code example that reproduces the
problem. You may provide a screenshot of the application if you think it is
relevant to your bug report. Here are some tips for providing a minimal
example: https://stackoverflow.com/help/mcve.
-->
## The current behavior
TypeError: Cannot read property 'store' of null
useSelector
./node_modules/@ice/store/node_modules/react-redux/es/hooks/useSelector.js:126:33
123 | }
124 |
125 | var _useReduxContext = useReduxContext(),
@ice/store version:
Steps To Reproduce
const counter = { state: 0, reducers: { increment: (prevState) => prevState + 1, decrement: (prevState) => prevState - 1, }, effects: () => ({ async asyncDecrement() { await delay(1000); this.decrement(); }, }), };
const { useModel } = createStore({ counter, });
function FunctionComponent() { const [state, dispatchers] = useModel('counter');
return
{state}
; }TypeError: Cannot read property 'store' of null useSelector ./node_modules/@ice/store/node_modules/react-redux/es/hooks/useSelector.js:126:33 123 | } 124 | 125 | var _useReduxContext = useReduxContext(),
useModel('counter');
执行这里报错 版本是 1.4.3