finds.dev← search

// the find

gaearon/react-document-title

★ 1,851 · JavaScript · MIT · updated Oct 2019

Declarative, nested, stateful, isomorphic document.title for React

A thin wrapper around react-side-effect that lets you set document.title declaratively in React component trees, with innermost-wins nesting semantics. It handles SSR via a rewind() call after renderToString. This is a solved problem from 2015.

- The nesting model is genuinely useful — wrapping your app shell with a default title and overriding per-page is cleaner than imperative document.title assignments scattered through componentDidMount hooks

- Zero DOM output, so it doesn't pollute your rendered HTML

- SSR support via rewind() works correctly and the memory-leak warning about calling it is honest and accurate

- The implementation is tiny — index.js is probably 20 lines wrapping react-side-effect, so there's almost nothing to go wrong

- Abandoned since 2019 and the React ecosystem has moved on — React Helmet Async, or just the native <title> element in React 19's document metadata support, handle this without a dependency

- React 18+ concurrent mode can cause issues with the underlying react-side-effect synchronous reducer model — this hasn't been tested or updated for modern React

- Only handles document.title; the moment you need og:title or description meta tags you're ripping this out for React Helmet anyway

- bower.json in 2026 is a red flag; the project's tooling is frozen in amber and there's been no maintenance signal in seven years

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →