Skip to content
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

Closed
wanecek opened this issue Aug 23, 2018 · 6 comments
Closed

Documentation for ShallowWrapper.setProps out of sync #1788

wanecek opened this issue Aug 23, 2018 · 6 comments

Comments

@wanecek
Copy link
Contributor

wanecek commented Aug 23, 2018

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 the nextProps (.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

@ljharb
Copy link
Member

ljharb commented Aug 24, 2018

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)

@ljharb ljharb closed this as completed Aug 24, 2018
@ljharb ljharb added the docs label Aug 24, 2018
@wanecek
Copy link
Contributor Author

wanecek commented Aug 25, 2018

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

screenshot-2018-08-25t17 20 54

[email protected]/docs/api/ShallowWrapper/setProps.md

screenshot-2018-08-25t17 20 27

@ljharb
Copy link
Member

ljharb commented Aug 25, 2018

Thanks, you’re right. A PR to fix that would be appreciated.

@ljharb ljharb reopened this Aug 25, 2018
@wanecek
Copy link
Contributor Author

wanecek commented Aug 26, 2018

Will do! Just to confirm, the intended behaviour is to allow a callback, right?

@ljharb
Copy link
Member

ljharb commented Aug 26, 2018

Yes

@ljharb
Copy link
Member

ljharb commented Aug 26, 2018

Fixed by #1791.

@ljharb ljharb closed this as completed Aug 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants