-
Notifications
You must be signed in to change notification settings - Fork 932
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 the option suppressRefError
to getRootProps
.
#241
Conversation
Codecov Report
@@ Coverage Diff @@
## master #241 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 4 4
Lines 296 299 +3
Branches 71 72 +1
=====================================
+ Hits 296 299 +3
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.
This looks perfect! Thank you very much!
I'm going to go ahead and ask that we wait for another maintainer to review this as well 👌 thank you! |
Would you like to add yourself to the contributors table? |
.all-contributorsrc
Outdated
"profile": "http://algolab.eu/pirola", | ||
"contributions": [ | ||
"bug", | ||
"code" |
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.
You could add "test"
to this too if you want. Just update the file and commit. It'll update the readme in a commit hook 👍
Sorry, I'm not sure what happened with this PR! Do you mind resolving conflicts and I'll get it merged. Easiest way to resolve all-contributors conflicts is to just fix the |
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.
Perfect!
One day we'll have a bot so you wont have to worry about dealing with merge conflicts in the contributors table... 😅 |
Thanks so much for your help here and in #252! I've added you as a collaborator on the project. Please make sure that you review the |
…-js#241) * Add the option `suppressRefError` to `getRootProps`. Fixes downshift-js#235. * Add myself as contributor. * Fix Markdown in README. * Add also 'test' as contribution.
Fixes #235.
What:
The option
suppressRefError
has been added togetRootProps
to bypass the ref check when it erroneously raises an error.Why:
As discussed in #235, a ref could be correctly forwarded to the root DOM element of a composite child but the ref check could still fail.
The new option allows to bypass such a check.
How:
A new optional argument of
getRootProps
has been introduced.This argument must be an object and if it has the key
suppressRefError
and if the corresponding value evaluates totrue
the ref check is bypassed (but the check thatgetRootProps
has been called is still performed).The introduction of the second argument of
getRootProps
instead of using a key in the first argument is intentional in order to clarify that it is not a prop forwarded to the root component.Checklist: