How to read a cookie set with document.cookie in loaders #12725
Unanswered
discoverlance-com
asked this question in
Q&A
Replies: 1 comment
-
Why dont use cookie helpers from framework https://reactrouter.com/explanation/sessions-and-cookies ? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am using shadcn ui with the sidebar component and it has this behaviour where you can persist the sidebar state in the cookie, this is how it typically sets the cookie with document.cookie:
But in my loader, when I get the cookies with
request.headers.get('cookie')
and I parse it, the response does not contain thesidebar:state
cookie. Is that something that I cannot change by design because of how loaders work or is there a way I can make this work?Beta Was this translation helpful? Give feedback.
All reactions