-
Notifications
You must be signed in to change notification settings - Fork 175
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
Unable to pass multiple groups to setUserObjectColors
#1290
Comments
Hi @gouldingken
The
|
That works. But it still throws the TypeScript error. I think you just need to fix the type syntax. |
From the error you are getting in you initial comment: The type you are trying to assign is incorrect and it's not what |
I have the code working fine. I just have to disable the type checking. I'm pretty sure it's just that the first '[' needs to come after the object type, not before. If this were expecting an array of numbers, you'd write it as number[], not [number], right? |
This might becoming a typescript lesson for all of us (especially me!) I think i wrote that function (?) and my intention was |
It's unclear if this is a bug or documentation issue (or user error), but I'm having trouble using the
setUserObjectColors
method:setUserObjectColors(groups: [{ objectIds: string[]; color: string }])
I'm not familiar with that TS syntax. If this is an array of objects that contain objectIds and a color, should that not be written as follows?:
groups: { objectIds: string[]; color: string }[]
The TS error I'm getting when I try to pass more than 1 element through is:
I've tried using the exact code specified in #1205 - but got the error above.
The text was updated successfully, but these errors were encountered: