Currently I have a useStore('') for a variable selected that corresponds to the value of a selected radio input button in a group of radio inputs. By default there should be no selected inputs. However, when reloading, sometimes the previous checked radio input button from before the reload remains in the UI, despite the state showing that it is an empty string. Could it be the cache?
#Input values not rerendering correctly using nanostore/react
3 messages · Page 1 of 1 (latest)
Hi @wary cloak. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
Based on the knowledge sources provided, there isn't specific information about the issue you're experiencing with nanostores/react and radio input buttons. However, it's worth noting that Astro has a feature called transition:persist-props which allows you to control whether or not an island’s props should be persisted upon navigation. By default, when you add transition:persist to an island, the state is retained upon navigation, but your component will re-render with new props. This could potentially be related to your issue if you're using Astro's islands and transitions features (source (https://docs.astro.build/en/guides/view-transitions/#transitionpersist-props)).
As for the caching issue, Astro recommends setting the proper cache headers for your pages to best support all browsers. For static or prerendered pages, the ETag header is often automatically set by the deployment platform and is expected to work out of the box. For dynamic and server-side rendered pages, you should set the appropriate cache headers yourself based on the page content (source (https://docs.astro.build/en/guides/prefetch/#recommendations)).