@xmachines/docs 1.0.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +15 -0
- package/api/@xmachines/play/README.md +130 -0
- package/api/@xmachines/play/type-aliases/PlayEvent.md +81 -0
- package/api/@xmachines/play-actor/README.md +247 -0
- package/api/@xmachines/play-actor/classes/AbstractActor.md +520 -0
- package/api/@xmachines/play-actor/interfaces/Routable.md +29 -0
- package/api/@xmachines/play-actor/interfaces/ViewMetadata.md +17 -0
- package/api/@xmachines/play-actor/interfaces/Viewable.md +12 -0
- package/api/@xmachines/play-catalog/README.md +331 -0
- package/api/@xmachines/play-catalog/functions/defineCatalog.md +98 -0
- package/api/@xmachines/play-catalog/functions/defineComponents.md +134 -0
- package/api/@xmachines/play-catalog/type-aliases/Catalog.md +48 -0
- package/api/@xmachines/play-catalog/type-aliases/ComponentsFor.md +20 -0
- package/api/@xmachines/play-catalog/type-aliases/InferComponentProps.md +65 -0
- package/api/@xmachines/play-catalog/type-aliases/NoExtraKeys.md +17 -0
- package/api/@xmachines/play-react/README.md +423 -0
- package/api/@xmachines/play-react/classes/PlayErrorBoundary.md +613 -0
- package/api/@xmachines/play-react/functions/useSignalEffect.md +68 -0
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryProps.md +15 -0
- package/api/@xmachines/play-react/interfaces/PlayErrorBoundaryState.md +14 -0
- package/api/@xmachines/play-react/interfaces/PlayRendererProps.md +15 -0
- package/api/@xmachines/play-react/variables/PlayRenderer.md +64 -0
- package/api/@xmachines/play-react-router/README.md +198 -0
- package/api/@xmachines/play-react-router/classes/ReactRouterBridge.md +321 -0
- package/api/@xmachines/play-react-router/classes/RouteMap.md +137 -0
- package/api/@xmachines/play-react-router/functions/PlayRouterProvider.md +19 -0
- package/api/@xmachines/play-react-router/functions/createRouteMapFromTree.md +35 -0
- package/api/@xmachines/play-react-router/interfaces/PlayRouteEvent.md +119 -0
- package/api/@xmachines/play-react-router/interfaces/PlayRouterProviderProps.md +14 -0
- package/api/@xmachines/play-react-router/interfaces/RouteMapping.md +17 -0
- package/api/@xmachines/play-react-router/interfaces/RouterBridge.md +104 -0
- package/api/@xmachines/play-react-router-demo/README.md +137 -0
- package/api/@xmachines/play-router/README.md +502 -0
- package/api/@xmachines/play-router/classes/BaseRouteMap.md +142 -0
- package/api/@xmachines/play-router/classes/RouterBridgeBase.md +300 -0
- package/api/@xmachines/play-router/functions/buildRouteTree.md +27 -0
- package/api/@xmachines/play-router/functions/connectRouter.md +67 -0
- package/api/@xmachines/play-router/functions/crawlMachine.md +92 -0
- package/api/@xmachines/play-router/functions/createBrowserHistory.md +47 -0
- package/api/@xmachines/play-router/functions/createRouteMap.md +53 -0
- package/api/@xmachines/play-router/functions/createRouter.md +76 -0
- package/api/@xmachines/play-router/functions/detectDuplicateRoutes.md +32 -0
- package/api/@xmachines/play-router/functions/extractMachineRoutes.md +64 -0
- package/api/@xmachines/play-router/functions/extractRoute.md +45 -0
- package/api/@xmachines/play-router/functions/findRouteById.md +37 -0
- package/api/@xmachines/play-router/functions/findRouteByPath.md +39 -0
- package/api/@xmachines/play-router/functions/getNavigableRoutes.md +35 -0
- package/api/@xmachines/play-router/functions/getRoutableRoutes.md +39 -0
- package/api/@xmachines/play-router/functions/routeExists.md +26 -0
- package/api/@xmachines/play-router/functions/validateRouteFormat.md +29 -0
- package/api/@xmachines/play-router/functions/validateStateExists.md +29 -0
- package/api/@xmachines/play-router/interfaces/BaseRouteMapping.md +27 -0
- package/api/@xmachines/play-router/interfaces/BrowserHistory.md +172 -0
- package/api/@xmachines/play-router/interfaces/BrowserWindow.md +69 -0
- package/api/@xmachines/play-router/interfaces/ConnectRouterOptions.md +13 -0
- package/api/@xmachines/play-router/interfaces/PlayRouteEvent.md +119 -0
- package/api/@xmachines/play-router/interfaces/RouteInfo.md +19 -0
- package/api/@xmachines/play-router/interfaces/RouteMap.md +56 -0
- package/api/@xmachines/play-router/interfaces/RouteNode.md +21 -0
- package/api/@xmachines/play-router/interfaces/RouteObject.md +21 -0
- package/api/@xmachines/play-router/interfaces/RouteTree.md +20 -0
- package/api/@xmachines/play-router/interfaces/RouterBridge.md +104 -0
- package/api/@xmachines/play-router/interfaces/StateVisit.md +15 -0
- package/api/@xmachines/play-router/interfaces/VanillaRouter.md +28 -0
- package/api/@xmachines/play-router/type-aliases/RouteMetadata.md +11 -0
- package/api/@xmachines/play-router-demo/README.md +137 -0
- package/api/@xmachines/play-signals/README.md +176 -0
- package/api/@xmachines/play-signals/interfaces/ComputedOptions.md +34 -0
- package/api/@xmachines/play-signals/interfaces/SignalComputed.md +49 -0
- package/api/@xmachines/play-signals/interfaces/SignalOptions.md +35 -0
- package/api/@xmachines/play-signals/interfaces/SignalState.md +68 -0
- package/api/@xmachines/play-signals/interfaces/SignalWatcher.md +97 -0
- package/api/@xmachines/play-signals/namespaces/Signal/README.md +22 -0
- package/api/@xmachines/play-signals/namespaces/Signal/classes/Computed.md +52 -0
- package/api/@xmachines/play-signals/namespaces/Signal/classes/State.md +72 -0
- package/api/@xmachines/play-signals/namespaces/Signal/interfaces/Options.md +19 -0
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/README.md +21 -0
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/classes/Watcher.md +85 -0
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/currentComputed.md +13 -0
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/hasSinks.md +19 -0
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/hasSources.md +19 -0
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/introspectSinks.md +19 -0
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/introspectSources.md +19 -0
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/functions/untrack.md +25 -0
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/variables/unwatched.md +9 -0
- package/api/@xmachines/play-signals/namespaces/Signal/namespaces/subtle/variables/watched.md +9 -0
- package/api/@xmachines/play-signals/namespaces/Signal/variables/isComputed.md +19 -0
- package/api/@xmachines/play-signals/namespaces/Signal/variables/isState.md +19 -0
- package/api/@xmachines/play-signals/namespaces/Signal/variables/isWatcher.md +19 -0
- package/api/@xmachines/play-signals/type-aliases/WatcherNotify.md +32 -0
- package/api/@xmachines/play-solid/README.md +311 -0
- package/api/@xmachines/play-solid/interfaces/PlayRendererProps.md +15 -0
- package/api/@xmachines/play-solid/variables/PlayRenderer.md +70 -0
- package/api/@xmachines/play-solid-router/README.md +666 -0
- package/api/@xmachines/play-solid-router/classes/RouteMap.md +150 -0
- package/api/@xmachines/play-solid-router/classes/SolidRouterBridge.md +347 -0
- package/api/@xmachines/play-solid-router/functions/PlayRouterProvider.md +19 -0
- package/api/@xmachines/play-solid-router/functions/createRouteMap.md +32 -0
- package/api/@xmachines/play-solid-router/interfaces/AbstractActor.md +486 -0
- package/api/@xmachines/play-solid-router/interfaces/PlayRouteEvent.md +119 -0
- package/api/@xmachines/play-solid-router/interfaces/PlayRouterProviderProps.md +14 -0
- package/api/@xmachines/play-solid-router/interfaces/RouteMapping.md +14 -0
- package/api/@xmachines/play-solid-router/interfaces/RouterBridge.md +104 -0
- package/api/@xmachines/play-solid-router/type-aliases/RoutableActor.md +9 -0
- package/api/@xmachines/play-solid-router/type-aliases/SolidRouterHooks.md +51 -0
- package/api/@xmachines/play-solid-router-demo/README.md +127 -0
- package/api/@xmachines/play-tanstack-react-router/README.md +226 -0
- package/api/@xmachines/play-tanstack-react-router/classes/RouteMap.md +137 -0
- package/api/@xmachines/play-tanstack-react-router/classes/TanStackReactRouterBridge.md +348 -0
- package/api/@xmachines/play-tanstack-react-router/functions/PlayRouterProvider.md +19 -0
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMap.md +53 -0
- package/api/@xmachines/play-tanstack-react-router/functions/createRouteMapFromTree.md +35 -0
- package/api/@xmachines/play-tanstack-react-router/functions/extractParams.md +38 -0
- package/api/@xmachines/play-tanstack-react-router/functions/extractQueryParams.md +33 -0
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouteEvent.md +119 -0
- package/api/@xmachines/play-tanstack-react-router/interfaces/PlayRouterProviderProps.md +14 -0
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteMapping.md +17 -0
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouteNavigateEvent.md +26 -0
- package/api/@xmachines/play-tanstack-react-router/interfaces/RouterBridge.md +104 -0
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterInstance.md +9 -0
- package/api/@xmachines/play-tanstack-react-router/type-aliases/TanStackRouterLike.md +78 -0
- package/api/@xmachines/play-tanstack-react-router/variables/extractMachineRoutes.md +64 -0
- package/api/@xmachines/play-tanstack-react-router-demo/README.md +126 -0
- package/api/@xmachines/play-tanstack-solid-router/README.md +285 -0
- package/api/@xmachines/play-tanstack-solid-router/classes/RouteMap.md +150 -0
- package/api/@xmachines/play-tanstack-solid-router/classes/SolidRouterBridge.md +343 -0
- package/api/@xmachines/play-tanstack-solid-router/functions/PlayRouterProvider.md +19 -0
- package/api/@xmachines/play-tanstack-solid-router/functions/createRouteMap.md +32 -0
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouteEvent.md +119 -0
- package/api/@xmachines/play-tanstack-solid-router/interfaces/PlayRouterProviderProps.md +14 -0
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouteMapping.md +23 -0
- package/api/@xmachines/play-tanstack-solid-router/interfaces/RouterBridge.md +104 -0
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/RoutableActor.md +9 -0
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterInstance.md +9 -0
- package/api/@xmachines/play-tanstack-solid-router/type-aliases/TanStackRouterLike.md +78 -0
- package/api/@xmachines/play-tanstack-solid-router-demo/README.md +126 -0
- package/api/@xmachines/play-vue/README.md +292 -0
- package/api/@xmachines/play-vue/interfaces/PlayRendererProps.md +14 -0
- package/api/@xmachines/play-vue/variables/PlayRenderer.md +9 -0
- package/api/@xmachines/play-vue-router/README.md +604 -0
- package/api/@xmachines/play-vue-router/classes/RouteMap.md +209 -0
- package/api/@xmachines/play-vue-router/classes/VueBaseRouteMap.md +201 -0
- package/api/@xmachines/play-vue-router/classes/VueRouterBridge.md +360 -0
- package/api/@xmachines/play-vue-router/functions/createRouteMap.md +19 -0
- package/api/@xmachines/play-vue-router/interfaces/PlayRouteEvent.md +119 -0
- package/api/@xmachines/play-vue-router/interfaces/RouteMapping.md +15 -0
- package/api/@xmachines/play-vue-router/interfaces/RouterBridge.md +104 -0
- package/api/@xmachines/play-vue-router/type-aliases/RoutableActor.md +9 -0
- package/api/@xmachines/play-vue-router/variables/PlayRouterProvider.md +67 -0
- package/api/@xmachines/play-vue-router-demo/README.md +133 -0
- package/api/@xmachines/play-xstate/README.md +512 -0
- package/api/@xmachines/play-xstate/classes/PlayerActor.md +527 -0
- package/api/@xmachines/play-xstate/functions/buildRouteUrl.md +43 -0
- package/api/@xmachines/play-xstate/functions/composeGuards.md +79 -0
- package/api/@xmachines/play-xstate/functions/composeGuardsOr.md +67 -0
- package/api/@xmachines/play-xstate/functions/definePlayer.md +127 -0
- package/api/@xmachines/play-xstate/functions/deriveRoute.md +109 -0
- package/api/@xmachines/play-xstate/functions/eventMatches.md +40 -0
- package/api/@xmachines/play-xstate/functions/formatPlayRouteTransitions.md +54 -0
- package/api/@xmachines/play-xstate/functions/hasContext.md +42 -0
- package/api/@xmachines/play-xstate/functions/isAbsoluteRoute.md +41 -0
- package/api/@xmachines/play-xstate/functions/mergeViewProps.md +26 -0
- package/api/@xmachines/play-xstate/functions/negateGuard.md +61 -0
- package/api/@xmachines/play-xstate/functions/stateMatches.md +25 -0
- package/api/@xmachines/play-xstate/functions/validateComponentBinding.md +39 -0
- package/api/@xmachines/play-xstate/functions/validateViewProps.md +80 -0
- package/api/@xmachines/play-xstate/interfaces/CatalogEntry.md +16 -0
- package/api/@xmachines/play-xstate/interfaces/PlayerConfig.md +24 -0
- package/api/@xmachines/play-xstate/interfaces/PlayerOptions.md +26 -0
- package/api/@xmachines/play-xstate/interfaces/RouteContext.md +22 -0
- package/api/@xmachines/play-xstate/type-aliases/Catalog.md +21 -0
- package/api/@xmachines/play-xstate/type-aliases/ComposedGuard.md +14 -0
- package/api/@xmachines/play-xstate/type-aliases/Guard.md +34 -0
- package/api/@xmachines/play-xstate/type-aliases/GuardArray.md +20 -0
- package/api/@xmachines/play-xstate/type-aliases/PlayerFactory.md +29 -0
- package/api/@xmachines/play-xstate/type-aliases/RouteMachineConfig.md +45 -0
- package/api/@xmachines/play-xstate/type-aliases/RouteStateNode.md +51 -0
- package/api/@xmachines/play-xstate/type-aliases/ValidationResult.md +17 -0
- package/api/@xmachines/play-xstate/type-aliases/ViewMergeContext.md +35 -0
- package/api/@xmachines/shared/README.md +379 -0
- package/api/@xmachines/shared/functions/defineXmVitestConfig.md +29 -0
- package/api/@xmachines/shared/functions/xmAliases.md +24 -0
- package/api/README.md +25 -0
- package/api/llms.txt +26 -0
- package/examples/README.md +63 -0
- package/examples/basic-state-machine.md +70 -0
- package/examples/form-validation.md +167 -0
- package/examples/multi-router-integration.md +277 -0
- package/examples/routing-patterns.md +260 -0
- package/examples/traffic-light.md +99 -0
- package/guides/README.md +29 -0
- package/guides/getting-started.md +223 -0
- package/guides/installation.md +323 -0
- package/index.d.ts +3 -0
- package/index.js +4 -0
- package/package.json +54 -0
|
@@ -0,0 +1,613 @@
|
|
|
1
|
+
[Documentation](../../../README.md) / [@xmachines/play-react](../README.md) / PlayErrorBoundary
|
|
2
|
+
|
|
3
|
+
# Class: PlayErrorBoundary
|
|
4
|
+
|
|
5
|
+
Defined in: [packages/play-react/src/PlayErrorBoundary.tsx:49](https://gitlab.com/xmachin-es/xmachines-js/-/blob/00a28432ed57807112288436d1ae4387d9f06919/packages/play-react/src/PlayErrorBoundary.tsx#L49)
|
|
6
|
+
|
|
7
|
+
React class component error boundary for catching catalog component render errors.
|
|
8
|
+
|
|
9
|
+
Wraps catalog component renders so failures are caught and forwarded to standard
|
|
10
|
+
React error boundary protocol. Consumers can attach the `onError` prop to forward
|
|
11
|
+
errors to production observability tools (Sentry, Datadog, etc.).
|
|
12
|
+
|
|
13
|
+
Per CONS-14: Class component pattern works with all React versions (18 and 19).
|
|
14
|
+
|
|
15
|
+
## Example
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
<PlayErrorBoundary fallback={<div>Something went wrong</div>} onError={Sentry.captureException}>
|
|
19
|
+
<CatalogComponent {...props} />
|
|
20
|
+
</PlayErrorBoundary>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Extends
|
|
24
|
+
|
|
25
|
+
- `Component`\<[`PlayErrorBoundaryProps`](../interfaces/PlayErrorBoundaryProps.md), [`PlayErrorBoundaryState`](../interfaces/PlayErrorBoundaryState.md)\>
|
|
26
|
+
|
|
27
|
+
## Constructors
|
|
28
|
+
|
|
29
|
+
### Constructor
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
new PlayErrorBoundary(props): PlayErrorBoundary;
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Defined in: [packages/play-react/src/PlayErrorBoundary.tsx:53](https://gitlab.com/xmachin-es/xmachines-js/-/blob/00a28432ed57807112288436d1ae4387d9f06919/packages/play-react/src/PlayErrorBoundary.tsx#L53)
|
|
36
|
+
|
|
37
|
+
#### Parameters
|
|
38
|
+
|
|
39
|
+
| Parameter | Type |
|
|
40
|
+
| --------- | ------------------------------------------------------------------- |
|
|
41
|
+
| `props` | [`PlayErrorBoundaryProps`](../interfaces/PlayErrorBoundaryProps.md) |
|
|
42
|
+
|
|
43
|
+
#### Returns
|
|
44
|
+
|
|
45
|
+
`PlayErrorBoundary`
|
|
46
|
+
|
|
47
|
+
#### Overrides
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
React.Component<
|
|
51
|
+
PlayErrorBoundaryProps,
|
|
52
|
+
PlayErrorBoundaryState
|
|
53
|
+
>.constructor
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Properties
|
|
57
|
+
|
|
58
|
+
| Property | Modifier | Type | Description | Inherited from | Defined in |
|
|
59
|
+
| ------------------------------------------------ | ---------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------- | ---------------------------------------- |
|
|
60
|
+
| <a id="property-context"></a> `context` | `public` | `unknown` | If using React Context, re-declare this in your class to be the `React.ContextType` of your `static contextType`. Should be used with type annotation or static contextType. **Example** `static contextType = MyContext // For TS pre-3.7: context!: React.ContextType<typeof MyContext> // For TS 3.7 and above: declare context: React.ContextType<typeof MyContext>` **See** [React Docs](https://react.dev/reference/react/Component#context) | `React.Component.context` | node_modules/@types/react/index.d.ts:955 |
|
|
61
|
+
| <a id="property-props"></a> `props` | `readonly` | `Readonly`\<`P`\> | - | `React.Component.props` | node_modules/@types/react/index.d.ts:979 |
|
|
62
|
+
| <a id="property-state"></a> `state` | `public` | `Readonly`\<`S`\> | - | `React.Component.state` | node_modules/@types/react/index.d.ts:980 |
|
|
63
|
+
| <a id="property-contexttype"></a> `contextType?` | `static` | `Context`\<`any`\> | If set, `this.context` will be set at runtime to the current value of the given Context. **Example** `type MyContext = number const Ctx = React.createContext<MyContext>(0) class Foo extends React.Component { static contextType = Ctx context!: React.ContextType<typeof Ctx> render () { return <>My context's value: {this.context}</>; } }` **See** [https://react.dev/reference/react/Component#static-contexttype](https://react.dev/reference/react/Component#static-contexttype) | `React.Component.contextType` | node_modules/@types/react/index.d.ts:931 |
|
|
64
|
+
| <a id="property-proptypes"></a> ~~`propTypes?`~~ | `static` | `any` | Ignored by React. **Deprecated** Only kept in types for backwards compatibility. Will be removed in a future major release. | `React.Component.propTypes` | node_modules/@types/react/index.d.ts:937 |
|
|
65
|
+
|
|
66
|
+
## Methods
|
|
67
|
+
|
|
68
|
+
### componentDidCatch()
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
componentDidCatch(error, info): void;
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Defined in: [packages/play-react/src/PlayErrorBoundary.tsx:62](https://gitlab.com/xmachin-es/xmachines-js/-/blob/00a28432ed57807112288436d1ae4387d9f06919/packages/play-react/src/PlayErrorBoundary.tsx#L62)
|
|
75
|
+
|
|
76
|
+
Catches exceptions generated in descendant components. Unhandled exceptions will cause
|
|
77
|
+
the entire component tree to unmount.
|
|
78
|
+
|
|
79
|
+
#### Parameters
|
|
80
|
+
|
|
81
|
+
| Parameter | Type |
|
|
82
|
+
| --------- | ----------- |
|
|
83
|
+
| `error` | `Error` |
|
|
84
|
+
| `info` | `ErrorInfo` |
|
|
85
|
+
|
|
86
|
+
#### Returns
|
|
87
|
+
|
|
88
|
+
`void`
|
|
89
|
+
|
|
90
|
+
#### Overrides
|
|
91
|
+
|
|
92
|
+
```ts
|
|
93
|
+
React.Component.componentDidCatch;
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
### componentDidMount()?
|
|
99
|
+
|
|
100
|
+
```ts
|
|
101
|
+
optional componentDidMount(): void;
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Defined in: node_modules/@types/react/index.d.ts:1198
|
|
105
|
+
|
|
106
|
+
Called immediately after a component is mounted. Setting state here will trigger re-rendering.
|
|
107
|
+
|
|
108
|
+
#### Returns
|
|
109
|
+
|
|
110
|
+
`void`
|
|
111
|
+
|
|
112
|
+
#### Inherited from
|
|
113
|
+
|
|
114
|
+
```ts
|
|
115
|
+
React.Component.componentDidMount;
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
### componentDidUpdate()?
|
|
121
|
+
|
|
122
|
+
```ts
|
|
123
|
+
optional componentDidUpdate(
|
|
124
|
+
prevProps,
|
|
125
|
+
prevState,
|
|
126
|
+
snapshot?): void;
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Defined in: node_modules/@types/react/index.d.ts:1261
|
|
130
|
+
|
|
131
|
+
Called immediately after updating occurs. Not called for the initial render.
|
|
132
|
+
|
|
133
|
+
The snapshot is only present if [getSnapshotBeforeUpdate](#getsnapshotbeforeupdate) is present and returns non-null.
|
|
134
|
+
|
|
135
|
+
#### Parameters
|
|
136
|
+
|
|
137
|
+
| Parameter | Type |
|
|
138
|
+
| ----------- | ----------------- |
|
|
139
|
+
| `prevProps` | `Readonly`\<`P`\> |
|
|
140
|
+
| `prevState` | `Readonly`\<`S`\> |
|
|
141
|
+
| `snapshot?` | `any` |
|
|
142
|
+
|
|
143
|
+
#### Returns
|
|
144
|
+
|
|
145
|
+
`void`
|
|
146
|
+
|
|
147
|
+
#### Inherited from
|
|
148
|
+
|
|
149
|
+
```ts
|
|
150
|
+
React.Component.componentDidUpdate;
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
### ~~componentWillMount()?~~
|
|
156
|
+
|
|
157
|
+
```ts
|
|
158
|
+
optional componentWillMount(): void;
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
Defined in: node_modules/@types/react/index.d.ts:1277
|
|
162
|
+
|
|
163
|
+
Called immediately before mounting occurs, and before Component.render.
|
|
164
|
+
Avoid introducing any side-effects or subscriptions in this method.
|
|
165
|
+
|
|
166
|
+
Note: the presence of [getSnapshotBeforeUpdate](#getsnapshotbeforeupdate)
|
|
167
|
+
or StaticLifecycle.getDerivedStateFromProps getDerivedStateFromProps prevents
|
|
168
|
+
this from being invoked.
|
|
169
|
+
|
|
170
|
+
#### Returns
|
|
171
|
+
|
|
172
|
+
`void`
|
|
173
|
+
|
|
174
|
+
#### Deprecated
|
|
175
|
+
|
|
176
|
+
16.3, use [componentDidMount](#componentdidmount) or the constructor instead; will stop working in React 17
|
|
177
|
+
|
|
178
|
+
#### See
|
|
179
|
+
|
|
180
|
+
- [https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#initializing-state](https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#initializing-state)
|
|
181
|
+
- [https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path](https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path)
|
|
182
|
+
|
|
183
|
+
#### Inherited from
|
|
184
|
+
|
|
185
|
+
```ts
|
|
186
|
+
React.Component.componentWillMount;
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
### ~~componentWillReceiveProps()?~~
|
|
192
|
+
|
|
193
|
+
```ts
|
|
194
|
+
optional componentWillReceiveProps(nextProps, nextContext): void;
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
Defined in: node_modules/@types/react/index.d.ts:1308
|
|
198
|
+
|
|
199
|
+
Called when the component may be receiving new props.
|
|
200
|
+
React may call this even if props have not changed, so be sure to compare new and existing
|
|
201
|
+
props if you only want to handle changes.
|
|
202
|
+
|
|
203
|
+
Calling [Component.setState](#setstate) generally does not trigger this method.
|
|
204
|
+
|
|
205
|
+
Note: the presence of [getSnapshotBeforeUpdate](#getsnapshotbeforeupdate)
|
|
206
|
+
or StaticLifecycle.getDerivedStateFromProps getDerivedStateFromProps prevents
|
|
207
|
+
this from being invoked.
|
|
208
|
+
|
|
209
|
+
#### Parameters
|
|
210
|
+
|
|
211
|
+
| Parameter | Type |
|
|
212
|
+
| ------------- | ----------------- |
|
|
213
|
+
| `nextProps` | `Readonly`\<`P`\> |
|
|
214
|
+
| `nextContext` | `any` |
|
|
215
|
+
|
|
216
|
+
#### Returns
|
|
217
|
+
|
|
218
|
+
`void`
|
|
219
|
+
|
|
220
|
+
#### Deprecated
|
|
221
|
+
|
|
222
|
+
16.3, use static StaticLifecycle.getDerivedStateFromProps getDerivedStateFromProps instead; will stop working in React 17
|
|
223
|
+
|
|
224
|
+
#### See
|
|
225
|
+
|
|
226
|
+
- [https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props](https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props)
|
|
227
|
+
- [https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path](https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path)
|
|
228
|
+
|
|
229
|
+
#### Inherited from
|
|
230
|
+
|
|
231
|
+
```ts
|
|
232
|
+
React.Component.componentWillReceiveProps;
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
### componentWillUnmount()?
|
|
238
|
+
|
|
239
|
+
```ts
|
|
240
|
+
optional componentWillUnmount(): void;
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
Defined in: node_modules/@types/react/index.d.ts:1214
|
|
244
|
+
|
|
245
|
+
Called immediately before a component is destroyed. Perform any necessary cleanup in this method, such as
|
|
246
|
+
cancelled network requests, or cleaning up any DOM elements created in `componentDidMount`.
|
|
247
|
+
|
|
248
|
+
#### Returns
|
|
249
|
+
|
|
250
|
+
`void`
|
|
251
|
+
|
|
252
|
+
#### Inherited from
|
|
253
|
+
|
|
254
|
+
```ts
|
|
255
|
+
React.Component.componentWillUnmount;
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
260
|
+
### ~~componentWillUpdate()?~~
|
|
261
|
+
|
|
262
|
+
```ts
|
|
263
|
+
optional componentWillUpdate(
|
|
264
|
+
nextProps,
|
|
265
|
+
nextState,
|
|
266
|
+
nextContext): void;
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
Defined in: node_modules/@types/react/index.d.ts:1340
|
|
270
|
+
|
|
271
|
+
Called immediately before rendering when new props or state is received. Not called for the initial render.
|
|
272
|
+
|
|
273
|
+
Note: You cannot call [Component.setState](#setstate) here.
|
|
274
|
+
|
|
275
|
+
Note: the presence of [getSnapshotBeforeUpdate](#getsnapshotbeforeupdate)
|
|
276
|
+
or StaticLifecycle.getDerivedStateFromProps getDerivedStateFromProps prevents
|
|
277
|
+
this from being invoked.
|
|
278
|
+
|
|
279
|
+
#### Parameters
|
|
280
|
+
|
|
281
|
+
| Parameter | Type |
|
|
282
|
+
| ------------- | ----------------- |
|
|
283
|
+
| `nextProps` | `Readonly`\<`P`\> |
|
|
284
|
+
| `nextState` | `Readonly`\<`S`\> |
|
|
285
|
+
| `nextContext` | `any` |
|
|
286
|
+
|
|
287
|
+
#### Returns
|
|
288
|
+
|
|
289
|
+
`void`
|
|
290
|
+
|
|
291
|
+
#### Deprecated
|
|
292
|
+
|
|
293
|
+
16.3, use getSnapshotBeforeUpdate instead; will stop working in React 17
|
|
294
|
+
|
|
295
|
+
#### See
|
|
296
|
+
|
|
297
|
+
- [https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update](https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update)
|
|
298
|
+
- [https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path](https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path)
|
|
299
|
+
|
|
300
|
+
#### Inherited from
|
|
301
|
+
|
|
302
|
+
```ts
|
|
303
|
+
React.Component.componentWillUpdate;
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
---
|
|
307
|
+
|
|
308
|
+
### forceUpdate()
|
|
309
|
+
|
|
310
|
+
```ts
|
|
311
|
+
forceUpdate(callback?): void;
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
Defined in: node_modules/@types/react/index.d.ts:976
|
|
315
|
+
|
|
316
|
+
#### Parameters
|
|
317
|
+
|
|
318
|
+
| Parameter | Type |
|
|
319
|
+
| ----------- | ------------ |
|
|
320
|
+
| `callback?` | () => `void` |
|
|
321
|
+
|
|
322
|
+
#### Returns
|
|
323
|
+
|
|
324
|
+
`void`
|
|
325
|
+
|
|
326
|
+
#### Inherited from
|
|
327
|
+
|
|
328
|
+
```ts
|
|
329
|
+
React.Component.forceUpdate;
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
---
|
|
333
|
+
|
|
334
|
+
### getSnapshotBeforeUpdate()?
|
|
335
|
+
|
|
336
|
+
```ts
|
|
337
|
+
optional getSnapshotBeforeUpdate(prevProps, prevState): any;
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
Defined in: node_modules/@types/react/index.d.ts:1255
|
|
341
|
+
|
|
342
|
+
Runs before React applies the result of Component.render render to the document, and
|
|
343
|
+
returns an object to be given to [componentDidUpdate](#componentdidupdate). Useful for saving
|
|
344
|
+
things such as scroll position before Component.render render causes changes to it.
|
|
345
|
+
|
|
346
|
+
Note: the presence of this method prevents any of the deprecated
|
|
347
|
+
lifecycle events from running.
|
|
348
|
+
|
|
349
|
+
#### Parameters
|
|
350
|
+
|
|
351
|
+
| Parameter | Type |
|
|
352
|
+
| ----------- | ----------------- |
|
|
353
|
+
| `prevProps` | `Readonly`\<`P`\> |
|
|
354
|
+
| `prevState` | `Readonly`\<`S`\> |
|
|
355
|
+
|
|
356
|
+
#### Returns
|
|
357
|
+
|
|
358
|
+
`any`
|
|
359
|
+
|
|
360
|
+
#### Inherited from
|
|
361
|
+
|
|
362
|
+
```ts
|
|
363
|
+
React.Component.getSnapshotBeforeUpdate;
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
---
|
|
367
|
+
|
|
368
|
+
### render()
|
|
369
|
+
|
|
370
|
+
```ts
|
|
371
|
+
render(): ReactNode;
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
Defined in: [packages/play-react/src/PlayErrorBoundary.tsx:67](https://gitlab.com/xmachin-es/xmachines-js/-/blob/00a28432ed57807112288436d1ae4387d9f06919/packages/play-react/src/PlayErrorBoundary.tsx#L67)
|
|
375
|
+
|
|
376
|
+
#### Returns
|
|
377
|
+
|
|
378
|
+
`ReactNode`
|
|
379
|
+
|
|
380
|
+
#### Overrides
|
|
381
|
+
|
|
382
|
+
```ts
|
|
383
|
+
React.Component.render;
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
---
|
|
387
|
+
|
|
388
|
+
### setState()
|
|
389
|
+
|
|
390
|
+
```ts
|
|
391
|
+
setState<K>(state, callback?): void;
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
Defined in: node_modules/@types/react/index.d.ts:971
|
|
395
|
+
|
|
396
|
+
#### Type Parameters
|
|
397
|
+
|
|
398
|
+
| Type Parameter |
|
|
399
|
+
| --------------------------------------------------------------------------------------- |
|
|
400
|
+
| `K` _extends_ keyof [`PlayErrorBoundaryState`](../interfaces/PlayErrorBoundaryState.md) |
|
|
401
|
+
|
|
402
|
+
#### Parameters
|
|
403
|
+
|
|
404
|
+
| Parameter | Type |
|
|
405
|
+
| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
406
|
+
| `state` | \| [`PlayErrorBoundaryState`](../interfaces/PlayErrorBoundaryState.md) \| ((`prevState`, `props`) => \| [`PlayErrorBoundaryState`](../interfaces/PlayErrorBoundaryState.md) \| `Pick`\<[`PlayErrorBoundaryState`](../interfaces/PlayErrorBoundaryState.md), `K`\> \| `null`) \| `Pick`\<[`PlayErrorBoundaryState`](../interfaces/PlayErrorBoundaryState.md), `K`\> \| `null` |
|
|
407
|
+
| `callback?` | () => `void` |
|
|
408
|
+
|
|
409
|
+
#### Returns
|
|
410
|
+
|
|
411
|
+
`void`
|
|
412
|
+
|
|
413
|
+
#### Inherited from
|
|
414
|
+
|
|
415
|
+
```ts
|
|
416
|
+
React.Component.setState;
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
---
|
|
420
|
+
|
|
421
|
+
### shouldComponentUpdate()?
|
|
422
|
+
|
|
423
|
+
```ts
|
|
424
|
+
optional shouldComponentUpdate(
|
|
425
|
+
nextProps,
|
|
426
|
+
nextState,
|
|
427
|
+
nextContext): boolean;
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
Defined in: node_modules/@types/react/index.d.ts:1209
|
|
431
|
+
|
|
432
|
+
Called to determine whether the change in props and state should trigger a re-render.
|
|
433
|
+
|
|
434
|
+
`Component` always returns true.
|
|
435
|
+
`PureComponent` implements a shallow comparison on props and state and returns true if any
|
|
436
|
+
props or states have changed.
|
|
437
|
+
|
|
438
|
+
If false is returned, Component.render, `componentWillUpdate`
|
|
439
|
+
and `componentDidUpdate` will not be called.
|
|
440
|
+
|
|
441
|
+
#### Parameters
|
|
442
|
+
|
|
443
|
+
| Parameter | Type |
|
|
444
|
+
| ------------- | ----------------- |
|
|
445
|
+
| `nextProps` | `Readonly`\<`P`\> |
|
|
446
|
+
| `nextState` | `Readonly`\<`S`\> |
|
|
447
|
+
| `nextContext` | `any` |
|
|
448
|
+
|
|
449
|
+
#### Returns
|
|
450
|
+
|
|
451
|
+
`boolean`
|
|
452
|
+
|
|
453
|
+
#### Inherited from
|
|
454
|
+
|
|
455
|
+
```ts
|
|
456
|
+
React.Component.shouldComponentUpdate;
|
|
457
|
+
```
|
|
458
|
+
|
|
459
|
+
---
|
|
460
|
+
|
|
461
|
+
### ~~UNSAFE_componentWillMount()?~~
|
|
462
|
+
|
|
463
|
+
```ts
|
|
464
|
+
optional UNSAFE_componentWillMount(): void;
|
|
465
|
+
```
|
|
466
|
+
|
|
467
|
+
Defined in: node_modules/@types/react/index.d.ts:1292
|
|
468
|
+
|
|
469
|
+
Called immediately before mounting occurs, and before Component.render.
|
|
470
|
+
Avoid introducing any side-effects or subscriptions in this method.
|
|
471
|
+
|
|
472
|
+
This method will not stop working in React 17.
|
|
473
|
+
|
|
474
|
+
Note: the presence of [getSnapshotBeforeUpdate](#getsnapshotbeforeupdate)
|
|
475
|
+
or StaticLifecycle.getDerivedStateFromProps getDerivedStateFromProps prevents
|
|
476
|
+
this from being invoked.
|
|
477
|
+
|
|
478
|
+
#### Returns
|
|
479
|
+
|
|
480
|
+
`void`
|
|
481
|
+
|
|
482
|
+
#### Deprecated
|
|
483
|
+
|
|
484
|
+
16.3, use [componentDidMount](#componentdidmount) or the constructor instead
|
|
485
|
+
|
|
486
|
+
#### See
|
|
487
|
+
|
|
488
|
+
- [https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#initializing-state](https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#initializing-state)
|
|
489
|
+
- [https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path](https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path)
|
|
490
|
+
|
|
491
|
+
#### Inherited from
|
|
492
|
+
|
|
493
|
+
```ts
|
|
494
|
+
React.Component.UNSAFE_componentWillMount;
|
|
495
|
+
```
|
|
496
|
+
|
|
497
|
+
---
|
|
498
|
+
|
|
499
|
+
### ~~UNSAFE_componentWillReceiveProps()?~~
|
|
500
|
+
|
|
501
|
+
```ts
|
|
502
|
+
optional UNSAFE_componentWillReceiveProps(nextProps, nextContext): void;
|
|
503
|
+
```
|
|
504
|
+
|
|
505
|
+
Defined in: node_modules/@types/react/index.d.ts:1326
|
|
506
|
+
|
|
507
|
+
Called when the component may be receiving new props.
|
|
508
|
+
React may call this even if props have not changed, so be sure to compare new and existing
|
|
509
|
+
props if you only want to handle changes.
|
|
510
|
+
|
|
511
|
+
Calling [Component.setState](#setstate) generally does not trigger this method.
|
|
512
|
+
|
|
513
|
+
This method will not stop working in React 17.
|
|
514
|
+
|
|
515
|
+
Note: the presence of [getSnapshotBeforeUpdate](#getsnapshotbeforeupdate)
|
|
516
|
+
or StaticLifecycle.getDerivedStateFromProps getDerivedStateFromProps prevents
|
|
517
|
+
this from being invoked.
|
|
518
|
+
|
|
519
|
+
#### Parameters
|
|
520
|
+
|
|
521
|
+
| Parameter | Type |
|
|
522
|
+
| ------------- | ----------------- |
|
|
523
|
+
| `nextProps` | `Readonly`\<`P`\> |
|
|
524
|
+
| `nextContext` | `any` |
|
|
525
|
+
|
|
526
|
+
#### Returns
|
|
527
|
+
|
|
528
|
+
`void`
|
|
529
|
+
|
|
530
|
+
#### Deprecated
|
|
531
|
+
|
|
532
|
+
16.3, use static StaticLifecycle.getDerivedStateFromProps getDerivedStateFromProps instead
|
|
533
|
+
|
|
534
|
+
#### See
|
|
535
|
+
|
|
536
|
+
- [https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props](https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props)
|
|
537
|
+
- [https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path](https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path)
|
|
538
|
+
|
|
539
|
+
#### Inherited from
|
|
540
|
+
|
|
541
|
+
```ts
|
|
542
|
+
React.Component.UNSAFE_componentWillReceiveProps;
|
|
543
|
+
```
|
|
544
|
+
|
|
545
|
+
---
|
|
546
|
+
|
|
547
|
+
### ~~UNSAFE_componentWillUpdate()?~~
|
|
548
|
+
|
|
549
|
+
```ts
|
|
550
|
+
optional UNSAFE_componentWillUpdate(
|
|
551
|
+
nextProps,
|
|
552
|
+
nextState,
|
|
553
|
+
nextContext): void;
|
|
554
|
+
```
|
|
555
|
+
|
|
556
|
+
Defined in: node_modules/@types/react/index.d.ts:1356
|
|
557
|
+
|
|
558
|
+
Called immediately before rendering when new props or state is received. Not called for the initial render.
|
|
559
|
+
|
|
560
|
+
Note: You cannot call [Component.setState](#setstate) here.
|
|
561
|
+
|
|
562
|
+
This method will not stop working in React 17.
|
|
563
|
+
|
|
564
|
+
Note: the presence of [getSnapshotBeforeUpdate](#getsnapshotbeforeupdate)
|
|
565
|
+
or StaticLifecycle.getDerivedStateFromProps getDerivedStateFromProps prevents
|
|
566
|
+
this from being invoked.
|
|
567
|
+
|
|
568
|
+
#### Parameters
|
|
569
|
+
|
|
570
|
+
| Parameter | Type |
|
|
571
|
+
| ------------- | ----------------- |
|
|
572
|
+
| `nextProps` | `Readonly`\<`P`\> |
|
|
573
|
+
| `nextState` | `Readonly`\<`S`\> |
|
|
574
|
+
| `nextContext` | `any` |
|
|
575
|
+
|
|
576
|
+
#### Returns
|
|
577
|
+
|
|
578
|
+
`void`
|
|
579
|
+
|
|
580
|
+
#### Deprecated
|
|
581
|
+
|
|
582
|
+
16.3, use getSnapshotBeforeUpdate instead
|
|
583
|
+
|
|
584
|
+
#### See
|
|
585
|
+
|
|
586
|
+
- [https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update](https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update)
|
|
587
|
+
- [https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path](https://legacy.reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path)
|
|
588
|
+
|
|
589
|
+
#### Inherited from
|
|
590
|
+
|
|
591
|
+
```ts
|
|
592
|
+
React.Component.UNSAFE_componentWillUpdate;
|
|
593
|
+
```
|
|
594
|
+
|
|
595
|
+
---
|
|
596
|
+
|
|
597
|
+
### getDerivedStateFromError()
|
|
598
|
+
|
|
599
|
+
```ts
|
|
600
|
+
static getDerivedStateFromError(error): PlayErrorBoundaryState;
|
|
601
|
+
```
|
|
602
|
+
|
|
603
|
+
Defined in: [packages/play-react/src/PlayErrorBoundary.tsx:58](https://gitlab.com/xmachin-es/xmachines-js/-/blob/00a28432ed57807112288436d1ae4387d9f06919/packages/play-react/src/PlayErrorBoundary.tsx#L58)
|
|
604
|
+
|
|
605
|
+
#### Parameters
|
|
606
|
+
|
|
607
|
+
| Parameter | Type |
|
|
608
|
+
| --------- | ------- |
|
|
609
|
+
| `error` | `Error` |
|
|
610
|
+
|
|
611
|
+
#### Returns
|
|
612
|
+
|
|
613
|
+
[`PlayErrorBoundaryState`](../interfaces/PlayErrorBoundaryState.md)
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
[Documentation](../../../README.md) / [@xmachines/play-react](../README.md) / useSignalEffect
|
|
2
|
+
|
|
3
|
+
# Function: useSignalEffect()
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
function useSignalEffect(callback): void;
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Defined in: [packages/play-react/src/useSignalEffect.ts:65](https://gitlab.com/xmachin-es/xmachines-js/-/blob/00a28432ed57807112288436d1ae4387d9f06919/packages/play-react/src/useSignalEffect.ts#L65)
|
|
10
|
+
|
|
11
|
+
React hook that subscribes to signal changes and runs effect callback
|
|
12
|
+
|
|
13
|
+
Wraps Signal.subtle.Watcher to automatically track signal dependencies
|
|
14
|
+
accessed in the callback. When any tracked signal changes, the callback
|
|
15
|
+
re-runs and React component re-renders.
|
|
16
|
+
|
|
17
|
+
Architecture (per RESEARCH.md Pattern 3):
|
|
18
|
+
|
|
19
|
+
- Uses Signal.Computed to wrap callback for automatic dependency tracking
|
|
20
|
+
- Signal.subtle.Watcher monitors the Computed for changes
|
|
21
|
+
- Microtask batching coalesces rapid signal updates
|
|
22
|
+
- Forces React re-render via useReducer when signals change
|
|
23
|
+
- Handles cleanup on unmount to prevent memory leaks
|
|
24
|
+
|
|
25
|
+
Invariant: Signal-Only Reactivity - Signals accessed in callback are watched.
|
|
26
|
+
Invariant: Passive Infrastructure - React observes signals and does not control them.
|
|
27
|
+
|
|
28
|
+
## Parameters
|
|
29
|
+
|
|
30
|
+
| Parameter | Type | Description |
|
|
31
|
+
| ---------- | ------------------------------ | ------------------------------------------------------------------- |
|
|
32
|
+
| `callback` | () => `void` \| (() => `void`) | Effect function that accesses signals. Can return cleanup function. |
|
|
33
|
+
|
|
34
|
+
## Returns
|
|
35
|
+
|
|
36
|
+
`void`
|
|
37
|
+
|
|
38
|
+
## Example
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
const MyComponent = ({ actor }) => {
|
|
42
|
+
const [view, setView] = useState(null);
|
|
43
|
+
|
|
44
|
+
// Subscribe to actor.currentView signal
|
|
45
|
+
useSignalEffect(() => {
|
|
46
|
+
const currentView = actor.currentView.get();
|
|
47
|
+
setView(currentView);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
return <div>{view?.component}</div>;
|
|
51
|
+
};
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Remarks
|
|
55
|
+
|
|
56
|
+
**CRITICAL:** Signals must be accessed unconditionally (no if statements).
|
|
57
|
+
Conditional signal access breaks automatic dependency tracking.
|
|
58
|
+
|
|
59
|
+
**Performance:** Microtask batching (queueMicrotask) prevents React thrashing
|
|
60
|
+
when multiple signals update rapidly. Per signal-polyfill README pattern.
|
|
61
|
+
|
|
62
|
+
**Why forceUpdate:** React needs useState/useReducer to trigger re-render cycle.
|
|
63
|
+
Signal changes won't automatically re-render React components without forcing
|
|
64
|
+
update via state change.
|
|
65
|
+
|
|
66
|
+
**Implementation note:** We wrap the callback in Signal.Computed because
|
|
67
|
+
Signal.subtle.Watcher cannot automatically track arbitrary function calls.
|
|
68
|
+
The Computed handles dependency tracking, and the Watcher monitors it.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
[Documentation](../../../README.md) / [@xmachines/play-react](../README.md) / PlayErrorBoundaryProps
|
|
2
|
+
|
|
3
|
+
# Interface: PlayErrorBoundaryProps
|
|
4
|
+
|
|
5
|
+
Defined in: [packages/play-react/src/PlayErrorBoundary.tsx:14](https://gitlab.com/xmachin-es/xmachines-js/-/blob/00a28432ed57807112288436d1ae4387d9f06919/packages/play-react/src/PlayErrorBoundary.tsx#L14)
|
|
6
|
+
|
|
7
|
+
Props for PlayErrorBoundary
|
|
8
|
+
|
|
9
|
+
## Properties
|
|
10
|
+
|
|
11
|
+
| Property | Type | Description | Defined in |
|
|
12
|
+
| ------------------------------------------ | --------------------------- | --------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
13
|
+
| <a id="property-children"></a> `children` | `ReactNode` | Child components to render | [packages/play-react/src/PlayErrorBoundary.tsx:18](https://gitlab.com/xmachin-es/xmachines-js/-/blob/00a28432ed57807112288436d1ae4387d9f06919/packages/play-react/src/PlayErrorBoundary.tsx#L18) |
|
|
14
|
+
| <a id="property-fallback"></a> `fallback?` | `ReactNode` | Fallback UI to render when a child component throws. Defaults to null. | [packages/play-react/src/PlayErrorBoundary.tsx:16](https://gitlab.com/xmachin-es/xmachines-js/-/blob/00a28432ed57807112288436d1ae4387d9f06919/packages/play-react/src/PlayErrorBoundary.tsx#L16) |
|
|
15
|
+
| <a id="property-onerror"></a> `onError?` | (`error`, `info`) => `void` | Optional error handler callback — forwards errors to observability tools (Sentry, etc.) | [packages/play-react/src/PlayErrorBoundary.tsx:20](https://gitlab.com/xmachin-es/xmachines-js/-/blob/00a28432ed57807112288436d1ae4387d9f06919/packages/play-react/src/PlayErrorBoundary.tsx#L20) |
|