// the find
jaredpalmer/react-fns
Browser API's turned into declarative React components and HoC's
react-fns wraps a grab-bag of imperative browser APIs — geolocation, device motion, network status, scroll position, window size, locale — into declarative React render-prop components and HOCs. It's aimed at older React codebases, pre-hooks, that want these one-off browser APIs without writing the subscribe/unsubscribe glue by hand.
Each browser API is its own small, isolated module (DeviceMotion, Network, Scroll, WindowSize, etc.) so you can cherry-pick just the one you need instead of pulling in a monolith. Several of the core modules (Network, Scroll, WindowSize) have real unit tests alongside the implementation. The whole thing is TypeScript, so the render-prop and HOC signatures are typed rather than left to guesswork like a lot of its era-mates.
The entire API surface is render props and HOCs with zero hooks equivalent, which means adopting this now means fighting the pattern every React codebase has used since 16.8 — most of what it does is a 10-line custom hook today. No commits since January 2023, and nothing in the README suggests it's still maintained. The README itself is almost entirely contributor credits and a doctoc TOC stub; there's no actual usage example for any single component, so you're forced out to an external Netlify docs site that isn't guaranteed to still resolve. No mention of tree-shaking or per-component imports, so it's unclear whether pulling in one API like WindowSize drags in the rest of the package.