Skip to content

Function: usePlayView()

API / @xmachines/play-react / usePlayView

function usePlayView(): ViewContextValue;

Defined in: packages/play-react/src/ActorProvider.tsx:72

Hook to access the current view spec, handlers, and registry.

Must be called inside or .

Returns

ViewContextValue

Throws

If called outside an ActorProvider/PlayUIProvider tree

Example

import { usePlayView } from "@xmachines/play-react";
function MyRenderer() {
const view = usePlayView();
return <Renderer spec={view.spec} registry={view.registry} />;
}