[inula-connectRouter] 增加支持inulax状态管理器功能

This commit is contained in:
wangxinrong 2023-11-01 20:44:41 +08:00
parent a6797335f9
commit 8af8f15ce4
1 changed files with 6 additions and 1 deletions

View File

@ -130,9 +130,14 @@ function getConnectedRouter(type: StoreType) {
);
};
const ConnectHRouterWithContext = (props: any) => {
const { store, ...rest } = props;
return <ConnectedRouter store={store} storeType={type} {...rest} />;
};
// 针对不同的Store类型使用对应的connect函数
if (type === 'InulaXCompat') {
return hConnect(null as any, mapDispatchToProps)(ConnectedRouterWithContext as any);
return hConnect(null as any, mapDispatchToProps)(ConnectHRouterWithContext as any);
}
if (type === 'Redux') {
return connect(null, mapDispatchToProps)(ConnectedRouterWithContext);