You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
maybe this is a stupid question but how can I work with ShorthandValues?
Lets say I have something like this: let defaultVal: ShorthandValue<DropdownItemProps> = getMeAValueFromSomewhere();
How can I access for example the "header" or "selected" value of the DropdownItemProps now? VSCode says Property 'selected' does not exist on type 'ShorthandValue<DropdownItemProps>'. Property 'selected' does not exist on type 'string'.ts(2339)
Is my tsconfig somehow wrong? Am I missing any types? Or do I have to convert the value to something useful before like this? (defaultVal as DropdownItemProps).selected = true;
For some reason my searchable dropdown is not showing any default value, and cant even set the defaultSearchQuery parameter since I cant access the header value. Any help is appreciated!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hey,
maybe this is a stupid question but how can I work with ShorthandValues?
Lets say I have something like this:
let defaultVal: ShorthandValue<DropdownItemProps> = getMeAValueFromSomewhere();
How can I access for example the "header" or "selected" value of the DropdownItemProps now? VSCode says
Property 'selected' does not exist on type 'ShorthandValue<DropdownItemProps>'. Property 'selected' does not exist on type 'string'.ts(2339)
Is my tsconfig somehow wrong? Am I missing any types? Or do I have to convert the value to something useful before like this?
(defaultVal as DropdownItemProps).selected = true;
For some reason my searchable dropdown is not showing any default value, and cant even set the defaultSearchQuery parameter since I cant access the header value. Any help is appreciated!
Beta Was this translation helpful? Give feedback.
All reactions