-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add React PropTypes for Array and Object Props #9751
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Analysis results are not available for those commits View more on Code Climate. |
Codecov Report
@@ Coverage Diff @@
## main #9751 +/- ##
=======================================
Coverage ? 82.06%
=======================================
Files ? 98
Lines ? 5932
Branches ? 0
=======================================
Hits ? 4868
Misses ? 1064
Partials ? 0 |
RuthNjeri
approved these changes
Jun 9, 2021
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.
Great job @noi5e, it looks good to me!
pydevsg
approved these changes
Jun 9, 2021
jywarren
approved these changes
Jun 10, 2021
Thank you so much @noi5e - great work! |
reginaalyssa
pushed a commit
to reginaalyssa/plots2
that referenced
this pull request
Oct 16, 2021
billymoroney1
pushed a commit
to billymoroney1/plots2
that referenced
this pull request
Dec 28, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Part of a React rewrite of the comment system, see #9365.
See React docs on PropTypes. This PR adds PropType checking for array and object data that's passed down as props throughout the
App
.BEFORE: check to see if
currentUser
is an object.AFTER: check to see if
currentUser
is an object AND typecheck its properties:This increases the long-term maintainability of this project. PropTypes help with debugging and ensure that the data the app receives is valid.
@jywarren mentioned writing functional tests to make sure the controller is sending valid data to the client... IMO PropTypes can easily substitute for functional tests! 😄
(Example: PropTypes logs an error to the console if data doesn't match expectations:)
(This issue is part of the larger Comment Editor Overhaul Project with Outreachy. Refer to Planning Issue #9069 for more context)