FormidableLabs/react-ssr-prepass

Dispatcher loses hooks execution order

khmm12 opened this issue · 0 comments

Dispatcher loses correct hooks execution order when concurrency > 1. It tries to execute hook with state belonging to another one.

Stacktrace

TypeError: Cannot read property 'length' of undefined
    at areHookInputsEqual (/app/node_modules/react-ssr-prepass/src/internals/dispatcher.js:69:32)
    at Object.useMemo (/app/node_modules/react-ssr-prepass/src/internals/dispatcher.js:241:13)
    at useMemo (/app/node_modules/react/cjs/react.development.js:1643:21)
    at Component (/app/src/components/Component/index.ts)
    at renderWithHooks (/app/node_modules/react-ssr-prepass/src/internals/dispatcher.js:116:18)
    at render (/app/node_modules/react-ssr-prepass/src/render/functionComponent.js:52:12)
    at updateFunctionComponent (/app/node_modules/react-ssr-prepass/src/render/functionComponent.js:93:10)
    at /app/node_modules/react-ssr-prepass/src/index.js:61:18
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at prehydrateApplication (/app/src/index.ts)