Eldon
TTCTheo's Typesafe Cult
•Created by Eldon on 8/21/2024 in #questions
Next.js Use localStorage For Rendering Without Flash?
Hello,
I am trying to grab data from localStorage and use it to change the text in a button. This system should detect if a user has clicked the button before and say "continue" instead of "start." I made a
useUserHistory
hook to wrap this behaviour.
Only this version results in no error, but it always flashes "Start" until the value is retrieved.
When I use
and remove the first useEffect
, it seems to work, but I do get a error for localStorage not being defined.
I understand this is due to the server pre-rendering the initial value of useState, a behaviour I do not want in this case.
Should I rethink this entire system?8 replies
TTCTheo's Typesafe Cult
•Created by Eldon on 4/18/2024 in #questions
Drizzle Not Working At All On Backend
Hello,
I am using drizzle to make a password for me for my website which using a TOTP. I am using Create T3 with Drizzle to store the private key on the backend along with the validity and expiry. All calls to my Postgresql server result in extremely unuseful errors. Using Drizzle studio I can make calls to the database, but not from the backend. Here's my code, most of it is similar to a stock Create T3 app.
6 replies