Closed nimmolo closed 2 years ago
@nimmolo
Test @egjs/svelte-infinitegrid@4.1.2-beta.2 version.
Thank you :)
Thank you @daybrush -- That cleared up the error on class
attribute.
Now with version 4.1.2-beta.2
i'm getting a minor type error on <MasonryInfiniteGrid>
itself 🤔
(alias) class MasonryInfiniteGrid
import MasonryInfiniteGrid
Type '{ class: string; gap: number; items: any[]; itemBy: (item: any) => any; }' is not assignable to type 'IntrinsicAttributes & Record<string, any> & SveltInfiniteGridOptions & MasonryInfiniteGridOptions'.
Property 'status' is missing in type '{ class: string; gap: number; items: any[]; itemBy: (item: any) => any; }' but required in type 'SveltInfiniteGridOptions'.ts(2322)
It appears I also need to set the status
attribute -- maybe that should be optional?
If i add status={false}
it stops complaining, and there are no type errors
One more TS note, while you are working on types @daybrush - I know it is a separate issue, i am happy to open separate issue but maybe this is more convenient here.
For debugging I tried using let ig;
, <MasonryInfiniteGrid bind:this={ig}>
and onMount(() => { console.log(ig.getItems()); });
, but this returns an error: Uncaught (in promise) TypeError: ig is undefined
.
Am I declaring the variable ig
incorrectly?
@nimmolo
Hi - thanks @daybrush
4.1.2-beta.3
version, still getting the same error (version 4.1.3-beta.3
did not exist)onMount
is too early@nimmolo
Is there a status
option problem in 4.1.2-beta.3?
@daybrush sorry i should have been specific.
There seemed still the status
problem after updating to beta.3 last night when I wrote that comment.
But i just restarted VS Code, and the status
error is now gone. Thanks
Description
TS/eslint seems to be complaining that the
class
attribute on theMasonryInfiniteGrid
component is not valid? It's maybe not a big deal but the type might not be defined correctly. Error message:Steps to check or reproduce
I'm using
class
like this: