diff --git a/integrations/react/src/future/stackflow.tsx b/integrations/react/src/future/stackflow.tsx index 5ad84117..26822614 100644 --- a/integrations/react/src/future/stackflow.tsx +++ b/integrations/react/src/future/stackflow.tsx @@ -66,20 +66,6 @@ export function stackflow< loaderPlugin(input.config), ]; - const [activityComponentMap, setActivityComponentMap] = useState( - () => input.components, - ); - - const registerActivityComponent = useCallback( - ({ activityName, Component }) => { - setActivityComponentMap((prevState) => ({ - ...prevState, - [activityName]: Component, - })); - }, - [], - ); - const enoughPastTime = () => new Date().getTime() - input.config.transitionDuration * 2; @@ -114,6 +100,20 @@ export function stackflow< [], ); + const [activityComponentMap, setActivityComponentMap] = useState( + () => input.components, + ); + + const registerActivityComponent = useCallback( + ({ activityName, Component }) => { + setActivityComponentMap((prevState) => ({ + ...prevState, + [activityName]: Component, + })); + }, + [], + ); + const coreStore = useMemo(() => { const prevCoreStore = getCoreStore();