0

I am working on amp-website.

I have one page with list of items. And for each item there is one link(or button) which will show similar items. For showing similar items I am using amp-list.

Now problem is suppose I click on similar item link for one item and it will show me the similar items, and after that I came back to listing page from similar items popup and click on some others items similar item link and for that item if similar items is not present then similar item popup shows previous item's similar items.(Amp-list is not changing list)

How can I resolve this things. Means if similar items is not available I want to show "No similar items found" message and if similar items available then want to show that items.

yajiv
  • 2,901
  • 2
  • 15
  • 25

1 Answers1

0

When you use AMP State be aware that it merges received data but doesn't rewrite, so it may be a reason of your issue. When you get null it just put it in the state as a new value but all old values still available. To override your old result you need to set null for all old values

Alexander Grosul
  • 1,814
  • 2
  • 11
  • 12