couch-kit
    Preparing search index...

    Function GameHostProvider

    • React context provider that turns a React Native TV app into a local game server.

      Starts a static file server (for the web controller) and a WebSocket game server (for real-time state sync). Manages the canonical game state using the provided reducer and broadcasts state updates to all connected clients.

      Type Parameters

      Parameters

      • config: { children: ReactNode; config: GameHostConfig<S, A> }

        Host configuration including reducer, initial state, ports, and callbacks.

      Returns Element

      <GameHostProvider config={{ reducer: gameReducer, initialState }}>
      <GameScreen />
      </GameHostProvider>