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
Unexpected side-effect when providing containerId #169
Comments
@killthekitten Sorry to confuse you. This hook will automatically creates the container element for you if it doesn't exist. I have refine the documentation in the latest version, thank you. |
@wellyshen thanks for the update, looks better now. However, it feels like this behavior should be separated. If the container is present most of the time, but not always, it might ruin the UI. Imagine a dynamic |
@killthekitten Sorry I don’t fully understand your concerning. Currently, the library will creates the container element only when needed and removes the element once it’s not used. For the overall mechanism, which part can we improve? |
@wellyshen I'm concerned that providing a custom I can see three scenarios of using this:
The library covers the first two cases, but not the third one. I would suggest an option to enable/disable rendering the container automatically, i.e. |
Bug Report
Describe the Bug
The
containerId
parameter would create a new element with this id unless the container already exists. This is not a documented behaviour and I would expect an error in this case.The docs just say this:
How to Reproduce
containerId
that doesn't exist on the page to theusePortal
hook.containerId
.Expected Behavior
Error raised or nothing.
The text was updated successfully, but these errors were encountered: