-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Documentation for ShallowWrapper.setProps out of sync #1788
Comments
This is fine - the docs reflect the last published version, if you change from "master" to https://github.com/airbnb/enzyme/blob/enzyme%403.4.4/docs/api/ShallowWrapper/setProps.md, which matches that tag, you'll see they're in sync. The next time master is published, the docs will be updated. (When adding types for a specific version of anything, you'll always want to be be on the appropriate version tag, not on latest master) |
Thanks for taking your time to explain this, and for the advice regarding types! :) I may just be slow, but I still think the docs might be out of sync for 3.4.4 - compare [email protected]/docs/api/shallow.md with [email protected]/docs/api/ShallowWrapper/setProps.md. [email protected]/docs/api/shallow.md[email protected]/docs/api/ShallowWrapper/setProps.md |
Thanks, you’re right. A PR to fix that would be appreciated. |
Will do! Just to confirm, the intended behaviour is to allow a callback, right? |
Yes |
Fixed by #1791. |
Describe the bug
On the overview of functions for ShallowWrapper,
setProps
is denoted to accept a callback as the second argument (.setProps(nextProps[, callback]) => ShallowWrapper
). On the details page, it only documents accepting thenextProps
(.setProps(nextProps) => Self
).To Reproduce
N/A
Expected behavior
Since the callback does, in fact, seem to work, I would suggest documenting it (and also submitting a PR to
@types/enzyme
, which was how I noticed it). If it's intended to be deprecated, I suggest removing it from the overview and adding a note about in the details page.Screenshots
N/A
Desktop (please complete the following information):
N/A
Smartphone (please complete the following information):
N/A
Additional context
Seems to originate from #1361
The text was updated successfully, but these errors were encountered: