fix: Console error when removing workspace member offline by handling React.Fragment#79933
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes a console error that occurred when removing workspace members while offline. The error "Invalid prop style supplied to React.Fragment" was caused by the applyStrikeThrough function attempting to apply style props to React.Fragment elements, which only accept key and children props.
Changes:
- Added special handling for React.Fragment elements in the OfflineWithFeedback component's strikethrough logic
- The fix recreates Fragments with only valid props (key and children) and recursively applies strikethrough to their children
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (child.type === React.Fragment) { | ||
| const childProps = child.props as {children?: React.ReactNode}; | ||
| return React.createElement(React.Fragment, {key: child.key}, applyStrikeThrough(childProps.children)); | ||
| } |
There was a problem hiding this comment.
The PR description mentions that unit tests were added for this fix (checklist item "I added [unit tests]" is checked). However, no test file changes are visible in this diff. Consider adding unit tests that verify the React.Fragment handling works correctly, such as:
- A test that verifies strikethrough is correctly applied to children within a React.Fragment
- A test that confirms no console errors are thrown when processing React.Fragment children
- A test that ensures the key prop is preserved when recreating the Fragment
This would help prevent future regressions and validate the fix comprehensively.
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
@samranahm Could you help merge main? |
|
Sure. |
|
@truph01 All yours! 🙌 |
heyjennahay
left a comment
There was a problem hiding this comment.
Product review not required
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-01-27.at.10.32.33.movAndroid: mWeb ChromeScreen.Recording.2026-01-27.at.10.29.31.moviOS: HybridAppScreen.Recording.2026-01-27.at.10.30.57.moviOS: mWeb SafariScreen.Recording.2026-01-27.at.10.17.21.movMacOS: Chrome / SafariScreen.Recording.2026-01-27.at.10.09.05.mov |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/amyevans in version: 9.3.10-0 🚀
|
|
🚀 Deployed to production by https://github.com/roryabraham in version: 9.3.10-6 🚀
|
Explanation of Change
Fixed Issues
$ #79220
PROPOSAL: #79220 (comment)
Tests
stylesupplied toReact.Fragment.React.Fragmentcan only havekeyandchildrenprops."Tap Remove from confirm modal
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android.Native.mov
Android: mWeb Chrome
Android.mWeb.Chrome.mov
iOS: Native
IOS.Native.mov
iOS: mWeb Safari
IOS.mWeb.Safari.mov
MacOS: Chrome / Safari
macOS.chrome.mp4