-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
migrate: OptionRow to function component #28977
Conversation
@narefyev91 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Reviewer Checklist
Screenshots/VideosWebweb.movMobile Web - Chromeandroid-web.movMobile Web - Safariios-web.movDesktopdesktop.moviOSios.movAndroidandroid.mov |
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.
LGTM!
🎀 👀 🎀 C+ reviewed
Will you take a look at the PR? |
Yes, but seeing some conflicts again, sorry 🥲 |
src/components/OptionRow.js
Outdated
if (this.props.isDisabled === prevProps.isDisabled) { | ||
return; | ||
} | ||
let pressableRef = null; |
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.
I think the ref gets set after the component mounts. And we need to use useRef()
.
Otherwise, I think when OptionRow
re-renders this would be null
and the ref
won't get set.
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.
Yeah, I'm sorry I missed it.
Now updated
Conflicts were resolved |
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.
LGTM! Thanks!
🚀 Deployed to production by https://github.com/jasperhuangg in version: 1.3.83-11 🚀
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 1.3.83-11 🚀
|
1 similar comment
🚀 Deployed to production by https://github.com/jasperhuangg in version: 1.3.83-11 🚀
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 1.3.83-11 🚀
|
prevProps.showSelectedState === nextProps.showSelectedState && | ||
prevProps.highlightSelected === nextProps.highlightSelected && | ||
prevProps.showTitleTooltip === nextProps.showTitleTooltip && | ||
!_.isEqual(prevProps.option.icons, nextProps.option.icons) && |
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.
This was overlooked. !
should have been removed. Later it caused regression - #33353
Details
Refactor OptionRow component to function component
Fixed Issues
$ #16181
PROPOSAL: #16181 (comment)
Tests
Add to group
button, hover state should be removedAdd to group
or checkbox button and verify that button is changed correctlyOffline tests
Add to group
button, hover state should be removedAdd to group
or checkbox button and verify that button is changed correctlyQA Steps
Add to group
button, hover state should be removedAdd to group
or checkbox button and verify that button is changed correctlyPR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Web
16181_mac_chrome.mp4
Mobile Web - Chrome
16181_android_chrome.mp4
Mobile Web - Safari
16181_ios_safari.mp4
Desktop
16181_mac_desktop.mp4
iOS
16181_ios_native.mp4
Android
16181_android_native.mp4