Guidance on Client Refresh after Server Action
Hey all, just looking for some guidance or maybe a push in the right direction on how to handle the client side after a revalidatetag/revalidatepath options in a server component. I have the video below that's drawer component getting a promise passed to it then using React.use on the client.
Put some of the code below to follow all the way through but wanted to see if there's any thoughts. I'm initially thinking that it's not possible and have to use something client side like SWR but wanted to at least ask and see if anyone has something simple I'm just missing...
page.tsx
client-component.tsx
drawer-component.tsx
actions.ts
8 Replies
The main idea is to get the TenantUrl and Secret Token to show without the rerender and I meant to put sheet for what's shown in the video... the drawer only shows on mobile
just add more state bro 🤓☝🏿
Awful at satire over the internet here… is this the same as “just one more lane bro” ha…
no seriously
add some sort of "current-panel" state
and just do a switch with a default transition
Ha ok cool cool I’ll give it a go thanks!
Thanks for the tip. Another state and simple use of transitions solved it. Completely overlooked the transition side of it to begin with…
🙏🏿 no problem
u should've realised that the sidebar itself contains display state (active, display-thing1, display-thing2
also always try to update whats actually in the content rather than reload
take the idea of SPA and put it everywhere so each component can render all its states
Definitely, I'm going to refactor this one after thinking about it more with your comments. Extremely helpful again
np
👍🏿