gitmyhub

react-fns

TypeScript ★ 3.7k updated 3y ago

Browser API's turned into declarative React components and HoC's

react-fns is a library that wraps common browser APIs into React components and higher-order components. Browsers expose built-in capabilities through JavaScript, things like tracking scroll position, detecting network status, reading geolocation, or responding to window size changes. Normally you would wire those up manually using event listeners and lifecycle methods. react-fns packages them as ready-to-use React building blocks so you can access that information declaratively inside your component tree without writing the setup and teardown code yourself.

The library is installed via npm and works with standard React projects. The author is Jared Palmer, and the project has a dedicated website with an API reference that lists all the included components.

The README provided here is mostly a contributor list and does not enumerate which specific browser APIs are included. Readers who want to know exactly what the library covers should check the API reference on the project website, which is linked from the repository. The library had meaningful community traction as shown by its star count, though it was published during an earlier period in the React ecosystem when render-prop patterns and higher-order components were the common approach before hooks became standard.