You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I find usage of this library hard to grok. If I understand correctly, the current interface for rendering and rerendering a hook is something to this effect:
A downside to this is that as arguments grow, so too does the initial props object grow too.
Suggested implementation:
Another way to interact with rendering a hook would simply be switching over to an array of arguments. This would
allow handing the hook to render directly rather than providing an anonymous function:
I have no real alternatives--I just found myself struggling to get renderHook to work simply because I found the usage API to be unintuitive. I think my proposed solution would simplify interaction with the library, as hooks will always be functions and you will always provide arguments to a function, making an array a more expressive representation of function arguments than a javascript object.
I've addressed similar suggestions in #56 previously. I'll close this and move the suggestion over there to keep it all together and address talk to the idea there as well.
Describe the feature you'd like:
I find usage of this library hard to grok. If I understand correctly, the current interface for rendering and rerendering a hook is something to this effect:
A downside to this is that as arguments grow, so too does the initial props object grow too.
Suggested implementation:
Another way to interact with rendering a hook would simply be switching over to an array of arguments. This would
allow handing the hook to render directly rather than providing an anonymous function:
Describe alternatives you've considered:
I have no real alternatives--I just found myself struggling to get
renderHook
to work simply because I found the usage API to be unintuitive. I think my proposed solution would simplify interaction with the library, as hooks will always be functions and you will always provide arguments to a function, making an array a more expressive representation of function arguments than a javascript object.Teachability, Documentation, Adoption, Migration Strategy:
NOTE
I would be more than happy to implement this change to the API, given the fact that what I'm asking for is a decent amount of work.
The text was updated successfully, but these errors were encountered: