Repository navigation
v0.2.1
Compatibility release. No API changes — no code changes are needed to upgrade.
React 16.14 and 17 are now supported
peerDependencies was >=18.0.0 with no recorded rationale, which locked out consumers on React 16.14/17 that the library already worked on. It uses only useState, useEffect, useRef, useMemo, and useCallback — no React 18+ API.
The floor is 16.14.0, not 16.8.0 (hooks): the compiled output uses the automatic JSX runtime and so imports react/jsx-runtime, which first ships in 16.14.0. On 16.8–16.13 the package installs and then fails at bundle time on an unresolved module.
If you were installing with --legacy-peer-deps to work around the old range, you can drop that flag.
Fixed: broken types on React 19
The emitted .d.ts referenced JSX.Element and React.CSSProperties as globals with no import of react, so the published type surface resolved against whatever @types/react the consumer had. @types/react@19 removed the global JSX namespace, which broke React 19 consumers compiling with skipLibCheck: false:
dist/index.d.ts(40,76): error TS2503: Cannot find namespace 'JSX'.
Those types are now imported by name, which fixes React 19 and is what makes the wider floor viable.
Verified
Each version installed from a real tarball with clean peer resolution (no --legacy-peer-deps), typechecked at skipLibCheck: false, and put through a mount / re-render / unmount pass:
| React | Install | Typecheck | Runtime |
|---|---|---|---|
| 16.14.0 | ✅ | ✅ | ✅ |
| 17.0.2 | ✅ | ✅ | ✅ |
| 18.3.1 | ✅ | ✅ | ✅ |
| 19.2.7 | ✅ | ✅ | ✅ |
Note that the test suite does not run against the floor — @testing-library/react@16 requires React 18+. tests/react-compat.test.ts guards the part that can be checked statically: every name imported from react must be on an allowlist verified against 16.14.