-
Notifications
You must be signed in to change notification settings - Fork 272
docs(renderHook): remove references to error and all from renderHook API #963
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
docs(renderHook): remove references to error and all from renderHook API #963
Conversation
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.
Good job for spotting the difference with RTL.
Could you update docs to take into account generic parameters Result
and Props
used by renderHook
and RenderHookResult
as currently API.md
is mentioning any
website/docs/API.md
Outdated
all: Array<any> | ||
current: any, | ||
error: Error | ||
current: any |
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.
Since RenderHookResult
accepts generic Result
parameter we should use it instead of any
here.
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.
I hope my changes align with what you were thinking for this.
A React component to wrap the test component in when rendering. This is usually used to add context providers from `React.createContext` for the hook to access with `useContext`. `initialProps` and props subsequently set by `rerender` will be provided to the wrapper. | ||
A React component to wrap the test component in when rendering. This is usually used to add context providers from `React.createContext` for the hook to access with `useContext`. |
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.
While fixing the types, I also noticed that this is not true for your implementation either.
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.
Looks good! Thanks for applying type comments.
Summary
Correct the
renderHook
API docs asresult.error
andresult.all
were not included in the new RTL version ofrenderHook
. I also fixed a typo and renamed a test example to better describe what it is showing (both in the same file).Test plan
No testing is required other than reviewing the documentation changes.