Repository navigation
Replace react-redux with in-house Provider and hooks - #5964
Merged
Merged
Conversation
added 3 commits
October 22, 2026 13:55
react-redux@7.2.9 requires React 16.8-18 as a peer dependency. Web Chat only used its Provider and useDispatch/useSelector/useStore on an internal context. useSelector() keeps react-redux@7 behavior: re-renders through useReducer(), batched store notifications, and the new value is remembered before re-rendering. useSyncExternalStore() would re-render ahead of <GraphProvider> on React 18 and trip the development check in useActivities().
… outside event handlers
Eugene (OEvgeny)
marked this pull request as ready for review
October 22, 2026 21:58
Eugene (OEvgeny)
requested review from
William Wong (compulim),
Chris Whitten (cwhitten) and
TJ Durnford (tdurnford)
as code owners
October 22, 2026 21:58
William Wong (compulim)
approved these changes
Oct 22, 2026
2 of 11 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changelog Entry
Changed
react-reduxdependency, which conflicted with React 19 as a peer dependency, related to #5552, in PR #5964, by @OEvgenyDescription
react-redux@7.2.9requires React 16.8–18 as a peer dependency, so installing Web Chat with React 19 warns and fails with--strict-peer-deps. Web Chat only used itsProviderand three hooks on an internal context, which are now implemented in-house with the same behavior, andreact-reduxis removed fromapiandcomponent.Design
react-redux: 8 still caps React at 18, 9 requires React 18 or later.useSelector()re-renders throughuseReducer()likereact-redux@7, notuseSyncExternalStore()(react-redux@8/use-sync-external-store): on React 18 it re-renders ahead of<GraphProvider>'suseState()and the development check inuseActivities()throws (e.g.selectedAction.html).unstable_batchedUpdates(), asreact-redux@7does, so React 16/17 andReactDOM.render()re-render parent and child together.Specific Changes
WebChatReduxContext.ts:useSelector(selector, equalityFn),useDispatch(),useStore()replacing thereact-reduxhook factoriesWebChatReduxProvider.tsx: provides the store and a batchedsubscribe(), used by<Composer>WebChatReduxProvider.spec.tsx: parent and child re-render once together,equalityFnskips re-renders, dispatching in render re-renders onceapi,component: removedreact-reduxfrompackage.json.changelog/<PR#>-<slug>.mdReview Checklist
z-index)package.jsonandpackage-lock.jsonreviewed