fix(hooks): repair useStoreActions hook
This commit is contained in:
@@ -52,7 +52,7 @@ const NodeRenderer = (props: NodeRendererProps) => {
|
||||
nodeElement: entry.target as HTMLDivElement,
|
||||
}));
|
||||
|
||||
batchUpdateNodeDimensions({ updates });
|
||||
batchUpdateNodeDimensions(updates);
|
||||
});
|
||||
}, []);
|
||||
|
||||
|
||||
@@ -1,20 +1,17 @@
|
||||
import React, { FC } from 'react';
|
||||
import { Provider } from 'react-redux';
|
||||
import React, { FC, useContext } from 'react';
|
||||
import { Provider, ReactReduxContext } from 'react-redux';
|
||||
|
||||
import store from '../../store';
|
||||
// import { useStore } from '../../store/hooks';
|
||||
|
||||
const Wrapper: FC = ({ children }) => {
|
||||
// const reactFlowStore = useStore();
|
||||
// const isWrapepdWithReactFlowProvider = reactFlowStore?.getState()?.reactFlowVersion;
|
||||
const contextValue = useContext(ReactReduxContext);
|
||||
const isWrappedWithReactFlowProvider = contextValue?.store?.getState()?.reactFlowVersion;
|
||||
|
||||
// console.log(isWrapepdWithReactFlowProvider);
|
||||
|
||||
// if (isWrapepdWithReactFlowProvider) {
|
||||
// // we need to wrap it with a fragment because t's not allowed for children to be a ReactNode
|
||||
// // https://github.com/DefinitelyTyped/DefinitelyTyped/issues/18051
|
||||
// return <>{children}</>;
|
||||
// }
|
||||
if (isWrappedWithReactFlowProvider) {
|
||||
// we need to wrap it with a fragment because t's not allowed for children to be a ReactNode
|
||||
// https://github.com/DefinitelyTyped/DefinitelyTyped/issues/18051
|
||||
return <>{children}</>;
|
||||
}
|
||||
|
||||
return <Provider store={store}>{children}</Provider>;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user