#Is it possible to persist react component state with MPA and VT?

3 messages · Page 1 of 1 (latest)

quick smelt
#

Hi, I searched through docs, other github projects, youtube videos and articles, but I couldn't find an answer for this...

Simple example:

I have 2 pages, home and about, both of them using the same Layout.

The layout contains a react component, a typical counter for the example...

My question is: Is it possible to persist the counter state when I navigate from Home to About?

For the test, I just put a useEffect to console.log a message when the component is re-rendered... what happens is that the component is always re-rendered between navigations.

I tried to put different "client:*" directives, also playing with transition:persist and transition:persist-props (does this one do something at all?)

But I couldn't achieve what I want, with transition:persist the component is not interactive anymore.

Is this even possible or am I missing something here?

quick smelt
#

<@&1095491216776380548> can you help with this?

charred isle