Description
Currently when we apply SupplyParameterFromPersistentComponentState
or use the PersistentComponentState
APIs the data gets unconditionally serialized.
As we support different scenarios for persisting state, we want to have the ability to filter out when persistence happens for individual pieces of data.
For example, we want to let developers opting out of persisting state during prerendering and disconnection, and for enhanced navigation, receiving state updates should be opt-in.
To support this, we need to add a context parameter to PersistAsJson
that enables us to specify under which situations state persistence needs to take place.
The host responsible for triggering prerendering must take care of setting up the environment and filtering out properties that opt-out of persistence in that situation.