-
Notifications
You must be signed in to change notification settings - Fork 9
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
Hooks can't be used in a modal? #5
Comments
@mrbbot I still can't get this to work, any tips? |
Hey! 👋 Apologies for the delayed reply. Yes, this is intentional. All custom IDs need to be declared at the top level so they're the same across calls. Don't worry if you only use them in your export function cmd() {
const selectId = useSelectMenu(...);
const modalId = useModal(() => {
return (
<Message>
<Select id={selectId}>...</Select>
</Message>
);
});
// Ok to ignore selectId here
return <Modal id={modalId}>...</Modal>;
} |
That makes sense, thanks! Works now. Also it turns out I can't put a Select in an Embed, so it was outputting |
For example, anything that uses
useCustomId
likeuseSelect
can't be used in auseModal
context. Is this intentional (e.x. a constraint of the Discord API) or an oversight?The text was updated successfully, but these errors were encountered: