RRH 这是什么?
React Redux 依赖的简单 React Hooks 在使用 RHH 之前你必须安装一些依赖包。
react redux Install npm npm install rrh --save yarn yarn add rrh 如何使用Provider import React from 'react';
从'rrh'导入{ useProvider };
从'./reducer'导入reducer;
从“./middleware”导入中间件从“./child”导入子;
const Component = () => { const Provider = useProvider(() => ({ reducer, preloadedState: {count: 1}, storeEnhancer: applyMiddleware(middleware) }));
返回
从“React”连接导入React;
导入 { useSelector } from 'rrh';
const Child = (props) => { const selected = useS
评论0
最新资源