Colum Kelly

@columk.bsky.social

Fullstack Developer | Climbing | Paragliding

@wesbos.com thanks, that was my potluck q about NextJS. I'm still confused because revalidateTag also clears the client's router cache completely. In my testing, even calling it on a tag that doesn't exist does this. It makes all layouts and routes that were cached suspend again when navigating.

@tkdodo.eu is there a way to force a global state issue with Zustand on the server? I'm using it in Next.js without Context but I'm struggling to find any issue. I've tried running multiple browser sessions and a suite of e2e tests but everything seems to work fine, no state is shared between users.

Those considering server components should be thinking about bundle size vs. payload size. If most of the app is behind a login, will a slightly smaller bundle make a difference? If first-time visits are a priority (news, e-commerce), server components could be beneficial. #react #webdev #nextjs

Found a powerful use for CSS :has with server components. This would fit in @joshwcomeau.com's "Global detection" category. When a component is within a suspense boundary, it's very difficult to animate out of the fallback, since it's unmounted whenever the promise used by the component resolves...

Many Radix/Shadcn components hide the scrollbar when toggled, which can cause layout shift. Giving fixed elements a width of 100vw will make them stable. To stop the scrollbar to be hidden, use this rule. The html selector may seem unnecessary but it adds specificity. #css #shadcn #react #webdev

  html body[data-scroll-locked] {
    overflow: visible !important;
    margin-right: 0 !important;
  }

Callback refs are much cleaner than effects for DOM manipulation. This is a handy one I'm using to help the user overwrite the previous input after navigating back to the main search page. You can even add a cleanup function since React 19, which makes them safer for async tasks. #react #webdev

const selectInput = useCallback((node: HTMLInputElement | null) => {
    node?.select()
  }, [])

Mac users waking up to the Docker security issue, this fix is gaining consensus: brew uninstall --cask docker --force brew uninstall --formula docker --force brew install --cask docker brew install docker-compose #docker

@tonytula.com's Rejection is amazing. "He has so enveloped himself in linguistic forms, in artistic images, in mythical symbols or religious rites that he cannot see or know anything except by the interposition of this artificial medium." - Ernst Cassirer

This is great, it goes through the whole process of building a modal component. It starts simple and ends up close to what you get from a UI library. While reading, I realized that I can make one of the modals in my current project uncontrolled by passing it a trigger component.

Existential React questions and a perfect Modal Dialog

My step-by-step process for implementing a new feature from an idea to a production-ready solution using Modal Dialog as an example.

developerway.com