reset-state
Reset-state action is typically used to reset the state of the key inside the jig file and can be used further to reset the state of UI components and forms. To understand how to use states, see State.
Configuration options
There are multiple ways to set up a reset-state action within a jig:
As
onFocusaction that will be executed.As
onRefreshaction that will be executed.As the main action on the jig, and when you press the action, the
reset-stateaction will be executed.The
onPressandonChangeactions will be executed when you trigger theonPressoronChangeevent.
Examples and code snippets
reset-state onFocus/onRefresh
Reset-state action is used when the onFocus/onRefresh event is triggered to reset the component's state or key.
You can specify instanceId, this will be the name of the UI component.
And you need to specify the key, which will be the value of the UI component or the name of the key that you want to reset.
Example: See the full example in GitHub.
onFocus:
type: action.reset-state
options:
state: [email protected]onRefresh:
type: action.reset-state
options:
state: [email protected]reset-state as action
Reset-state action is used as the primary action on the jig, to reset-state of the component in the jig and its value.
You can specify instanceId, this will be the name of the UI component
And you need to specify the key, which will be the value of the UI component that you want to reset
Example:
See the full example in GitHub.
actions:
- children:
- type: action.reset-state
options:
title: Reset state of the form
state: [email protected]reset-state onPress/onChange
Reset-state action used on the list as onPress or onChange action, to reset-state of the component.
You can specify instanceId, this will be the name of the UI component.
And you need to specify the state, which will be the value of the UI component that you want to reset
Example:
See the full example in GitHub.
onPress:
type: action.reset-state
options:
state: [email protected]onChange:
type: action.reset-state
options:
state: [email protected]Last updated
Was this helpful?