You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add route + tests
* Add route tests
* Fix types
* Fix types
* One down
* Default to typegen disabled
* Remove stuff
* More progress
* Some surgery
* Actors
* This is fun
* This is fun
* More deletion
* Remove ResolveTypegenMeta type param
* Renaming
* Cleanup
* Remove typgenTypes files + mentions
* Simplification
* Rename TResolvedTypesMeta -> TTypes
* More simplification
* Strongly type meta keyes
* Add test
* Clean up State
* Consistency: use full state IDs
* Strongly type route events
* Deep routing
* Changeset
* Route by id with single event type
* Remove reenter prop
* Move route transition formatting to root
* Update packages/core/src/types.ts
Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
* Update routable states to use '#' prefix for navigation and adjust related tests and type definitions
* Add test
---------
Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Added routable states. States with `route: {}` and an explicit `id` can be navigated to from anywhere via a single `{ type: 'xstate.route', to: '#id' }` event.
6
+
7
+
```ts
8
+
const machine =setup({}).createMachine({
9
+
id: 'app',
10
+
initial: 'home',
11
+
states: {
12
+
home: { id: 'home', route: {} },
13
+
dashboard: {
14
+
initial: 'overview',
15
+
states: {
16
+
overview: { id: 'overview', route: {} },
17
+
settings: { id: 'settings', route: {} }
18
+
}
19
+
}
20
+
}
21
+
});
22
+
23
+
const actor =createActor(machine).start();
24
+
25
+
// Route directly to deeply nested state from anywhere
26
+
actor.send({ type: 'xstate.route', to: '#settings' });
target?: string|undefined;// `| undefined` makes `HistoryStateNodeConfig` compatible with this interface (it extends it) under `exactOptionalPropertyTypes`
0 commit comments