phaser-jsx
    Preparing search index...

    Function useState

    • A hook that lets you manage state for your game object.

      When the state is updated via the setter, it triggers a re-render of the associated game object.

      Type Parameters

      • Type

      Parameters

      • initialValue: Type

        The initial value for the state.

      Returns [Type, (value: Type | ((prev: Type) => Type)) => void]

      • An array with the current state value and a setter function.