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

Is there a way to dynamically add some node in Portal? #40

Open
chj-damon opened this issue Mar 1, 2023 · 1 comment
Open

Is there a way to dynamically add some node in Portal? #40

chj-damon opened this issue Mar 1, 2023 · 1 comment

Comments

@chj-damon
Copy link

I tried to design some functionalities like Modal.alertModal.confirm,which when developers call Modal.alert, it would display an alert modal programmatically.

export default function alert(props: AlertProps) {
    Portal.add(<AlertModal {...props} />);
}

is there a way to do so? Thanks

@chj-damon
Copy link
Author

since it's just a function, so I can't use usePortal in it.

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

1 participant