Skip to content

Add Support for React 18.3.1 and React 19 - #18

Open
esitarz wants to merge 8 commits into
ordercloud-api:developmentfrom
esitarz:feat/react-19-peer-support
Open

Add Support for React 18.3.1 and React 19#18
esitarz wants to merge 8 commits into
ordercloud-api:developmentfrom
esitarz:feat/react-19-peer-support

Conversation

@esitarz

@esitarz esitarz commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Expands react and react-dom peer ranges to include React 19, while retaining support for React 18.3.1. This ensures broader compatibility for consumers leveraging newer React versions.

Addresses an issue where Axios request interceptors could duplicate in React StrictMode by introducing an effect cleanup mechanism. Ensures useAuthMutation correctly invokes provided onError callbacks, preferring per-call handlers over global defaults. Guards localStorage access to prevent errors in non-browser environments.

Introduces a CI matrix to validate the library against both React 18.3.1 and React 19. Adds comprehensive Vitest integration tests for core hooks and provider functionality. Implements npm pack inspection and consumer validation scripts to ensure package integrity and correct peer dependency resolution. Updates ESLint to a flat configuration format and integrates linting and testing into CI workflows.

Updates documentation to reflect new peer dependency support and important installation considerations for React 19. Externalizes additional react-hook-form resolver dependencies in the library bundle.

Eric Sitarz and others added 8 commits May 11, 2026 16:33
Expand peer ranges so React 19 consumers can install without
peer conflicts, while keeping 18.3.1 as the minimum.

Co-authored-by: Cursor <cursoragent@cursor.com>
StrictMode remounts left duplicate Axios interceptors, and
useAuthMutation returned onError instead of calling it.
Also import JSX types for React 19 typecheck.

Co-authored-by: Cursor <cursoragent@cursor.com>
Cover provider context, auth query/mutation gating, form wiring,
and StrictMode interceptor lifecycle without deprecated test utils.

Co-authored-by: Cursor <cursoragent@cursor.com>
Run lint/test/build against React 18.3.1 and 19, inspect npm pack
output, and smoke-install the tarball in an isolated consumer.

Co-authored-by: Cursor <cursoragent@cursor.com>
Update install guidance and changelog; migrate ESLint to flat
config so CI lint works on ESLint 9.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add `test:consumer` script to `package.json` to run the packed consumer validation against React 18.3.1 and 19.

Update `scripts/validate-consumer.mjs` to:
- Remove `npm install --legacy-peer-deps`, as peer dependency issues are now resolved.
- Refine version checking to use `includes` for more flexible matching of React and ReactDOM versions, accommodating release candidates.
@esitarz esitarz linked an issue Aug 10, 2026 that may be closed by this pull request
5 tasks
@esitarz

esitarz commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator Author

that's a false positive now that we support react 18 and react 19

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support React 19 as a peer dependency in ordercloud-react-sdk

1 participant