Stone.js API
    Preparing search index...

    Class representing a ReactRuntime.

    This class is responsible for handling the React runtime environment, including create snapshots and managing errors.

    Index
    instance?: ReactRuntime

    The ReactRuntime instance.

    • Set html head tags.

      This method will set the head elements in the document.

      Parameters

      • value: HeadContext

        The head context to set.

      Returns void

    • Create a snapshot.

      This method will create a snapshot of the current event. If the environment is server, it will create a snapshot. If the environment is client, it will return the snapshot.

      Type Parameters

      • T

      Parameters

      • key: string

        The key to store the snapshot.

      • handler: (container?: IContainer) => Promiseable<T>

        The handler to create the snapshot.

      Returns Promise<T>

      The snapshot value.

    • Throw an error.

      This method will handle the error and render the error component. If no error handler is found, the error will be thrown.

      Parameters

      • error: any

        The error to throw.

      • statusCode: number = 500

        The status code to return.

      Returns Promise<void>

      void

      error