-
Notifications
You must be signed in to change notification settings - Fork 58
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
CPLAT-12205 Add WithTransition wrapper component to enable "controlled" transitions using props #621
Conversation
Security InsightsNo security relevant content was detected by automated scans. Action Items
Questions or Comments? Reach out on Slack: #support-infosec. |
8722965
to
8d23802
Compare
7fc288d
to
c8b72ed
Compare
c8b72ed
to
cc1dd22
Compare
cc1dd22
to
591a79a
Compare
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 all looks awesome! I just have one question, but it's a small one, and then I'm +1!
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.
Given the getDerivedStateFromProps
issues and deprecation concerns, is it possible to add controlled behavior to this component cleanly?
We might be better off starting fresh with a new TransitionPrimitive
component that's entirely props-based
591a79a
to
963915a
Compare
@greglittlefield-wf can you be more specific with what you're seeing as far as breaking the rules of hooks? All tests we used for the old component are passing, and we have a consumer +10. |
@aaronlademann-wf Mostly around dependencies in |
The current component has more edge cases and potentially incorrect code paths with the way it uses hooks, so I don't think that's enough to say the component in it's current state is bug-free. Bugs introduced by improper uses of hooks might not always be surfaced in simple usages / tests, but rather by sequences of rerenders. In this case, what about if you rerender the component when |
@greglittlefield-wf I have addressed your feedback. |
967d93d
+ Based on CR feedback that the functional patterns were not a good fit / robust enough to handle edge cases.
+10
|
@Workiva/release-management-p |
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.
+1 from RM
Motivation
Currently,
AbstractTransitionComponent
s can only be programmatically shown/hidden using theshow
/hide
/toggle
API methods on the instance.With React 16 componentry - this is not ideal since calling the methods from a parent component requires the use of a
ref
, and the child component is no longer guaranteed to have been mounted when the parent component is. This makes it very difficult to hide/show things within data-driven applications without having to work around runtime race conditions.Changes
WithTransition
wrapper component.This component is designed to have identical behavior to
AbstractTransitionComponent
, but allows the consumer to control the behavior using the value ofprops.isShown
.Release Notes
Add
WithTransition
wrapper component to enable "controlled" transitions using propsQA Checklist
Merge Checklist
While we perform many automated checks before auto-merging, some manual checks are needed: