-
Notifications
You must be signed in to change notification settings - Fork 227
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
fix(text-field): put foundation on state and do render input unless foundation is present #353
Conversation
…oundation is present
Codecov Report
@@ Coverage Diff @@
## master #353 +/- ##
==========================================
+ Coverage 96.86% 96.86% +<.01%
==========================================
Files 51 51
Lines 1816 1820 +4
Branches 210 211 +1
==========================================
+ Hits 1759 1763 +4
Misses 57 57
Continue to review full report at Codecov.
|
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.
What's the purpose of moving the foundation to state? Semantically foundation seems more like a variable that needs to be initialized rather than one that holds state or can be changed throughout the component's life cycle
Well the inner components of a component will be initialized first. In this case, text field initializes before it considers itself "mounted". So the 's componentDidMount is called before text field's componentDidMount. relies on the foundation existing, which only happens after the text field's componentDidMount. So by adding foundation to state, we can guarantee that the will always have a foundation. |
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.
Clarification for posterity: foundation is moved to state so that Text Field's componentDidMount
will trigger a re-render through setState
after initializing the foundation
…ts-web-react into fix/text-field/foundation-on-state
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the |
Test passing, but CLA is not passing because I accidentally merged @TroyTae's commits into this branch. I reverted, so will just merge into master. |
fixes #303