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

Compatibilities and features #32

Open
jjalonso opened this issue Oct 3, 2023 · 2 comments
Open

Compatibilities and features #32

jjalonso opened this issue Oct 3, 2023 · 2 comments

Comments

@jjalonso
Copy link

jjalonso commented Oct 3, 2023

Hi, I have some questions that maybe could be good to add in the README.

I saw that its compatible with useEffect and useState, and it opens me the doubt if there is some others which is not compatible about? what are the caveat of the lib in terms of compatibility or not able to use in specific scenarios depending of your presentational component?

thanks

@helloitsjoe
Copy link
Owner

Hi @jjalonso, I haven't run into problems with any other React hooks, I included useState in the docs because the usage might not be intuitive, and included useEffect because there was some confusion in #8. If you have a specific case that could use extra documentation I'm happy to consider it, but I think other hooks should be pretty straightforward.

@jjalonso
Copy link
Author

jjalonso commented Oct 3, 2023

Okay now is more clear, also I was thinking and trying to find any clue if was possible to pass the result of one hook to another hook.

One of my use cases is that I have a hook that returns some object, I also have another hook on the same composition, at the same level, where I need to access the object returned from the first hook mentioned.

This translates to a real case with react hook form, first hook create and return form methods (useForm) and another hook handle some useWatch, use effect and data filtering...
To be able to watch on this second Hook i need to use some methods and prop like "control" that was returned by the first mentioned Hook.

If that is not possible to do on the same composition, the only solutions could be that the first hook is used inside the others hooks or uses a nested component and composed there as a child...

Thanks for the support. I hope this thread also solves some doubts on other users.

@jjalonso jjalonso changed the title Doc Compatibilities and features Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants