This repository contains general-purpose functions for use with React and React DOM.
The library assumes that
react-dom are available at runtime.
The module is intended to be used with Rollup as a packaging tool, and no particular effort is made to scope the content by subject matter (beyond the dependency on React).
The library is written in TypeScript and includes type definitions.
For additional notes, see the
This library is 99% environment agnostic. However, it is compiled with the
dom lib because of one reference to
withAsync.tsx. In that particular case, the same effect could probably be
achieved by changing it to
global.setImmediate, which does not assume a
However, more consideration would be required before these functions could be deemed “isomorphic,” i.e. supporting server-side render. So for the moment this l ibrary makes a de facto assumption that it is used in a browser.
This codebase uses prettier as a formatter, and includes
a Gitlab CI step to verify this on commits. If you use editor integration
to get format-on-save (recommended), then no additional steps are necessary.
But you can also run
npm format before committing to validate.