Description
On your shopping page that you showed to the reader: https://amp.dev/documentation/examples/e-commerce/shopping_cart/ I tested it and noticed that after the first interaction(click on a specific add or subtract button) , there is a visual flash. This flash is only observed after the first interaction, but not after When the cart data needs to be updated in the cartitemlist state.
<script type="application/json">
{
But this makes the user experience unpleasant or frustrating. And I have an effective method to avoid that.
Alternatives Considered
Now, to avoid this problem, I initialized the data with AMP state via SRC from the remote source. For example...
During loading, the data will be automatically inserted into the cartitemlist state. If the user clicks any button, this updates the src file more quickly without displaying any flashing.
Additional Context
No response