Rich-Harris/svelte-cubed

Type 'Material | Material[]' is not assignable to type 'Material'.

tonyketcham opened this issue · 3 comments

three.js meshes can accept an array of materials, but the svelte-cubed Mesh wrappers are typed to only allow a single one.

Passing an array of materials to an SC.Mesh works, for example, but throws a type error.

I created a small fix in my cloned repository:
https://github.com/Myrmod/svelte-cubed/blob/mesh-material-typing/src/lib/components/objects/Mesh.svelte#L10

Can you check if this would solve the issue for you? For me it did.

Best regards

I created a small fix in my cloned repository: https://github.com/Myrmod/svelte-cubed/blob/mesh-material-typing/src/lib/components/objects/Mesh.svelte#L10

Can you check if this would solve the issue for you? For me it did.

Best regards

Maybe you can submit a pull request with this fix? :) I'm sure a lot of people would be happy.

I might if the repository is being actively developed again. For now I focus on svelte-babylon.