Skip to content

skipEffects flag value does not return to original value #63

Description

@mo36924

Throw a Promise in a function component with the Suspense.
SkipEffects flag value does not return to original value.

As an example, the following code causes an error.

import { equal } from "node:assert";
import { options } from "preact";
import { createElement, lazy, Suspense } from "preact/compat";
import prepass from "preact-ssr-prepass";

const skipEffects = "__s";
const Component = lazy(() => Promise.resolve({ default: () => null }));
const App = () => createElement(Suspense, { fallback: null }, createElement(Component, {}));
equal(options[skipEffects], undefined);

prepass(createElement(App, {})).then(() => {
  // This assertion fails because the `skipEffects` option is set to `true` in the `preact-ssr-prepass` module.
  equal(options[skipEffects], undefined);
});

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions