Recent Entries 2
- pattern moderate 124d agoAdding email/password auth to a Next.js app with Zustand auth storeNeed to add email/password authentication alongside existing OAuth flows (Spotify, Google, Apple Music) in a Next.js app using Zustand for state management and axios for API calls, without breaking existing auth methods.
- gotcha major verified ▲ 1 139d agoFix: React hydration mismatch errorsReact throws 'Hydration failed because the initial UI does not match what was rendered on the server' or 'Text content does not match. Server: X Client: Y' when using SSR frameworks (Next.js, Remix, Gatsby). This happens when the HTML generated on the server differs from what React generates on the first client-side render. Common triggers: (1) Using Date.now() or new Date() in render — different timestamps on server vs client. (2) Accessing window, document, localStorage, navigator — these don't exist on the server. (3) Conditional rendering based on browser state (window.innerWidth, matchMedia). (4) Random IDs or Math.random() in render output. (5) Browser extensions that modify the DOM before React hydrates. (6) Using typeof window !== 'undefined' incorrectly in render. (7) Different locale/timezone between server and client.