-
Notifications
You must be signed in to change notification settings - Fork 45
enhancement: update useRef types for React 19 compatibility #283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #283 +/- ##
==========================================
- Coverage 10.85% 10.85% -0.01%
==========================================
Files 360 360
Lines 9049 9050 +1
Branches 2574 2574
==========================================
Hits 982 982
- Misses 7991 7992 +1
Partials 76 76 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR updates the codebase for React 19 compatibility by updating useRef type signatures and forwardRef patterns to align with stricter type requirements in React 19.
- Updated
@types/reactfrom v18 to v19.2.7 - Modified all
useRefcalls that had implicit undefined to explicitT | undefinedtype annotations withundefinedas initial value - Updated
forwardReftype casts in ChannelMessageList and ChannelThreadMessageList components - Removed unnecessary
ReactElementimports and replaced withReact.ReactElementwith proper generic constraints
Reviewed changes
Copilot reviewed 25 out of 26 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Updated @types/react resolution from ^18 to ^19.1.1 |
| yarn.lock | Updated @types/react to v19.2.7, csstype to v3.2.3, removed @types/prop-types dependency, and reorganized package declarations |
| packages/uikit-utils/src/hooks/react-native.ts | Updated resolveRef type from implicit undefined to explicit ((value: void) => void) | undefined with undefined initial value |
| packages/uikit-utils/src/hooks/index.ts | Updated timeoutRef type from implicit undefined to explicit NodeJS.Timeout | undefined with undefined initial value |
| packages/uikit-react-native/src/hooks/useVoiceMessageInput.ts | Updated recordingPath ref type to explicitly include undefined |
| packages/uikit-react-native/src/hooks/usePushTokenRegistration.ts | Updated refreshListener ref type to explicitly include undefined |
| packages/uikit-react-native/src/hooks/useMentionTextInput.ts | Updated textInputRef type to explicitly include undefined |
| packages/uikit-react-native/src/fragments/createOpenChannelParticipantsFragment.tsx | Updated refreshSchedule ref type to explicitly include undefined |
| packages/uikit-react-native/src/fragments/createGroupChannelMembersFragment.tsx | Updated refreshSchedule ref type to explicitly include undefined |
| packages/uikit-react-native/src/domain/groupChannel/component/GroupChannelMessageList.tsx | Updated viewableMessages and unreadMessagesFloatingPropsRef types to explicitly include undefined |
| packages/uikit-react-native/src/components/ReactionBottomSheets/ReactionUserListBottomSheet.tsx | Updated scrollRef type to explicitly include undefined |
| packages/uikit-react-native/src/components/FileViewer/FileViewerContent.tsx | Updated imageSize ref type to explicitly include undefined |
| packages/uikit-react-native/src/components/ChannelThreadMessageList/index.tsx | Updated forwardRef type cast for React 19 compatibility with explicit generic function signature |
| packages/uikit-react-native/src/components/ChannelMessageList/index.tsx | Updated forwardRef type cast for React 19 compatibility with explicit generic function signature |
| packages/uikit-react-native-foundation/src/ui/Dialog/index.tsx | Updated waitDismissTimeout, waitDismissPromise, and workingDialogJob ref types to explicitly include undefined |
| packages/uikit-react-native-foundation/src/ui/Avatar/AvatarStack.tsx | Removed ReactElement import, added AvatarChildProps type definition, and updated cloneElement to use React.ReactElement with generic constraints |
| packages/uikit-react-native-foundation/src/ui/Avatar/AvatarGroup.tsx | Removed ReactElement import, added AvatarChildProps type definition, and updated cloneElement to use React.ReactElement with generic constraints |
| packages/uikit-react-native-foundation/src/components/ImageWithPlaceholder/index.tsx | Updated retryTimeoutRef type to explicitly include undefined |
| packages/uikit-chat-hooks/src/handler/useConnectionHandler.ts | Updated handlerRef type to explicitly include undefined |
| packages/uikit-chat-hooks/src/common/useUserList.ts | Updated query ref type to explicitly include undefined |
| packages/uikit-chat-hooks/src/channel/useOpenChannelMessages/useOpenChannelMessagesWithQuery.ts | Updated queryRef type to explicitly include undefined |
| packages/uikit-chat-hooks/src/channel/useOpenChannelList/useOpenChannelListWithQuery.ts | Updated queryRef type to explicitly include undefined |
| packages/uikit-chat-hooks/src/channel/useGroupChannelMessages/useGroupChannelMessagesWithQuery.ts | Updated queryRef type to explicitly include undefined |
| packages/uikit-chat-hooks/src/channel/useGroupChannelMessages/useGroupChannelMessagesWithCollection.ts | Updated collectionRef type to explicitly include undefined |
| packages/uikit-chat-hooks/src/channel/useGroupChannelList/useGroupChannelListWithQuery.ts | Updated queryRef type to explicitly include undefined |
| packages/uikit-chat-hooks/src/channel/useGroupChannelList/useGroupChannelListWithCollection.ts | Updated collectionRef type to explicitly include undefined |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
External Contributions
This project is not yet set up to accept pull requests from external contributors.
If you have a pull request that you believe should be accepted, please contact
the Developer Relations team [email protected] with details
and we'll evaluate if we can setup a CLA to allow for the contribution.
For Internal Contributors
[CLNP-7758](https://sendbird.atlassian.net/browse/CLNP-7758)
Description Of Changes
@types/reactfrom ^18 to ^19.1.1useRefcalls to include explicit initial value for React 19 compatibilityReact.cloneElementtype casting with explicit props typeforwardReftype casting for generic componentsTypes Of Changes
What types of changes does your code introduce to this project?
Put an
xin the boxes that apply_