Skip to content

Interface: PlayUIProviderProps

API / @xmachines/play-solid / PlayUIProviderProps

Defined in: packages/play-solid/src/PlayUIProvider.tsx:37

The props of PlayUIProvider — every ActorProvider prop, and also the props that it forwards to JSONUIProvider.

Extends

Properties

PropertyTypeDescriptionInherited fromDefined in
actorViewActorThe actor instance with the currentView atom. It requires the Viewable capability.ActorProviderProps.actorpackages/play-view/src/view-types.ts:169
childrenanyThe children. They are necessary, and they must hold a . You can also use the PlayUIProvider short formActorProviderProps.childrenpackages/play-solid/src/ActorProvider.tsx:153
fallback?anyThe optional fallback element. The provider shows it when currentView is null, and when the ErrorBoundary catches an errorActorProviderProps.fallbackpackages/play-solid/src/ActorProvider.tsx:117
functions?Record<string, ComputedFunction>Named functions for $computed expressions in propsJSONUIProviderProps.functions-
navigate?(path) => voidNavigation functionJSONUIProviderProps.navigate-
onError?(error, reset) => voidThe optional callback. The provider calls it when the SolidJS ErrorBoundary catches an error. While the error is active, the provider renders the fallback instead of its children. The provider clears the error on the next view emission (when currentView changes), so a view transition retries the render. Element-level catalog component throws are caught upstream by the per-element boundary of @json-render, and reported through onRenderError. This boundary is the outer net for everything else. The second parameter is the RESET, for a retry that the host starts — a “Retry” button of its own. It clears the caught error and renders again, and it resolves the view that the actor holds at the MOMENT OF THE CALL, so a host that keeps the callback cannot rewind the screen to the view that failed. A reset that the host calls from inside this handler starts no second retry, because no input changed between the two attempts, and a reset after the provider is disposed does nothing. The five renderers hold the same three rules. A handler that THROWS reaches no caller. The provider contains that throw, and it writes the throw to console.error. The fallback of this boundary is the RETURN of the callback that reports, so a throw that left this handler would take the fallback off the screen AND let the error escape the boundary. Report a failure from this handler. To ESCALATE one, raise it from a task of your own — queueMicrotask(() => { throw error; }) — which reaches the global handler of the page and leaves the containment whole. The five renderers hold this one rule.ActorProviderProps.onErrorpackages/play-solid/src/ActorProvider.tsx:148
onRenderError?RenderErrorHandlerThe provider calls it when one catalog component throws during a render. This handler replaces every onRenderError of defineRegistry.ActorProviderProps.onRenderErrorpackages/play-view/src/view-types.ts:183
registryResultDefineRegistryResultThe complete result of defineRegistry(). It holds the component registry and the factory of the action handlers.ActorProviderProps.registryResultpackages/play-view/src/view-types.ts:171
store?StateStoreThe optional external StateStore, which is the controlled mode. With this option, the provider ignores spec.state, and this store is the single source of truth. Without it, the provider makes a new @xstate/store atom for each view transition, with the values of spec.state.ActorProviderProps.storepackages/play-view/src/view-types.ts:178
validationFunctions?Record<string, (value, args?) => boolean>Custom validation functionsJSONUIProviderProps.validationFunctions-