# Making Referential Stability a Type in React and Preact

> Hacker News story 49064656 · language: en · submitted 2026-07-27
> Web version: https://zeli.app/story/49064656
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 27 · by [acmnrs](<https://news.ycombinator.com/user?id=acmnrs>) · 💬 4
[original](<https://jovidecroock.com/blog/referential-stability-types/>) · [HN discussion](<https://news.ycombinator.com/item?id=49064656>)

## Summary

I have spent too many hours chasing unnecessary re-renders caused by unstable references in React and Preact. To solve this, I designed a type system that enforces referential stability directly in the code. By using a unique brand, developers can ensure that arrays and callbacks passed to memoized components remain stable, preventing silent performance regressions. This approach shifts the burden of optimization from the component boundary back to the caller, making type errors the primary guardrail against inefficient code.

## Key quote

> An agent can't see a re-render it never rendered, but it can absolutely respond to a type error, that's the feedback loop it already runs on.

---

## Cite

- Page: https://zeli.app/story/49064656
- Date: 2026-07-27
- Source: jovidecroock.com (https://jovidecroock.com/blog/referential-stability-types/)
- Hacker News: https://news.ycombinator.com/item?id=49064656

## Other languages

- zh: https://zeli.app/zh/story/49064656 · markdown: https://zeli.app/zh/story/49064656.md
