-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
When using nested states in createMachineComponent, it would be nice to be able to specify one fallback component on a parent state, which will be used for all nested states that are not defined.
For example, I now have to do this when I want to render one component in all registration states, except loaded.subscribed.unsubscribe:
const RegistrationPageMachineComponent =
createMachineComponent<RegistrationMachine>({
Fallback: () => <FallbackComponent />,
states: {
loaded: {
Fallback: () => <FallbackComponent />,
states: {
subscribed: {
Fallback: () => <FallbackComponent />,
states: {
unsubscribe: () => <UnsubscribePage />,
},
},
},
},
},
})Instead of passing the same fallback component three times, it would be nice to just define it on the root:
const RegistrationPageMachineComponent =
createMachineComponent<RegistrationMachine>({
Fallback: () => <FallbackComponent />,
states: {
loaded: {
states: {
subscribed: {
states: {
unsubscribe: () => <UnsubscribePage />,
},
},
},
},
},
})Metadata
Metadata
Assignees
Labels
No labels