-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Description
Describe the bug
If an async function is passed to onSettled() the function is called correctly when the component mounts, but when the component is supposed to be unmounted, an error about "call not being a function" prevents it from unmounting.
My guess is that solid is getting the Promise as a return value from the function call and assuming it is the clean-up function. Later when it tries to call the Promise as a typical callback, it fails.
Your Example Website or App
https://solid2.netlify.app/#solidjs-repl:gIRySxz_QjKFyTW8zLCCxg
Steps to Reproduce the Bug or Issue
- go to https://solid2.netlify.app/#solidjs-repl:gIRySxz_QjKFyTW8zLCCxg
- click the [SUBMIT] button which should unmount the "unmount me!" component
- note the error that appears
Expected behavior
I expect async functions to be supported like they were with onMount().
If that is impossible, I expect a more explicit error to be presented when an async function is passed in so that I know what I am doing wrong and how to fix it
Screenshots or Videos
No response
Platform
- OS: linux
- Browser: chrome
- Version: 146.0.7680.153
Additional context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels