Skip to content

Callbacks in command (Loading Sub Commands ) #726

Answered by asabaylus
BurnedChris asked this question in Q&A
Discussion options

You must be logged in to vote

@burnsy it sounds like you want "sub-commands". There's an example in this codesandbox
https://codesandbox.io/s/react-command-palette-subcommands-gw1zy

The React Command Palette renders whatever list of commands it's passed at the time they are passed in. Using the closeOnSelect prop, the UI can be forced to remain open while the new commands are loaded. Provided the search is quick, under say 1-4 sec the user experience will be good.

When the user selects a child command the spinner can be displayed using the showSpinnerOnSelect prop.

Please let me know if you have any additional questions.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by asabaylus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #724 on May 14, 2021 11:44.