Container

(),

);

Custom Actions and Intents with arguments

To update actions that use intent arguments or hold state,
you need to modify the arguments to the invoke method.
In the example below, the code keeps the value of the
argument in the intent as part of the action instance.
This is because in the old design there is a new instance
of the action created each time it’s executed,
and the resulting action could be kept by the
ActionDispatcher to record the state.

In the example of post migration code below,
the new MyAction returns the state as the result
of calling invoke, since a new instance isn’t created
for each invocation. This state is returned to the caller of
Actions.invoke, or ActionDispatcher.invokeAction,
depending on how the action is invoked.

Code before migration:

class

MyIntent

extends

Intent

const

MyIntent