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

useMount doesn't allow async callbacks #284

Closed
hjeti opened this issue Dec 5, 2023 · 0 comments · Fixed by #291
Closed

useMount doesn't allow async callbacks #284

hjeti opened this issue Dec 5, 2023 · 0 comments · Fixed by #291
Assignees
Labels
enhancement New feature or request

Comments

@hjeti
Copy link
Collaborator

hjeti commented Dec 5, 2023

The useMount doesn't allow async callbacks just like react-use. The callback is now probably directly passed to a useEffect behind the scenes. It would be great if we can add support for async callbacks. That saves us using the ugly IIFE setup.

This is probably the same for useUnmount but I never do async things in the unmount.

@leroykorterink leroykorterink self-assigned this Dec 8, 2023
@leroykorterink leroykorterink added the enhancement New feature or request label Dec 8, 2023
@leroykorterink leroykorterink linked a pull request Dec 8, 2023 that will close this issue
leroykorterink added a commit that referenced this issue Dec 8, 2023
…nc-callbacks

Allow async callback function in useMount #284
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants