Skip to content

1681-engine / react / askChoice

Function: askChoice() ​

ts
function askChoice(
   text, 
   options, 
   words?
): Promise<string | null>;

Defined in: src/react/choiceStore.ts:27

Asks the player to pick one of options; resolves its id, or null when cancelled.

Parameters ​

ParameterType
textReactNode
optionsreadonly ChoiceOption[]
words{ cancel?: string; confirm?: string; }
words.cancel?string
words.confirm?string

Returns ​

Promise<string | null>

Released under the MIT License.