Hi,
Thanks for the quick action on fixing the version mismatch!
Regarding 1., I am aware of strict mode calling useEffect()
getting called twice and know that it's intentional. My point was that since it's quickly doing construct -> dispose -> construct under strict mode, it seems like the error was because when dispose()
was called, the loading mark wasn't even loaded, eventually causing dispose()
getting called on a null object. I know that calling the constructor twice is completely possible (making 2 animations showing on the same page is one of the cases), but allowing quick construct -> dispose -> construct might be something worth addressing?
You should react to your effect called twice to avoid it to make side effects twice.
I have a hacky custom useEffect hook that would do so, but I feel like allowing disposal even before loading mark shows up shouldn't cause any error. It's fine if you think it should still give error though! I can just use my own custom useEffect so it only trigger the effect once in strict mode.
I didn't supply any value so it should be whatever value (likely true
) by default. Specifying false
gives me roundy head of the character. Thanks!
I guess you did not make the animation.
Yes, I am not the maker of the animation. Didn't know that there's a "skin" setting exists. Thanks! On top of that, Calling player.skeleton.data.skins
gives me what skins are available.
That's exactly the missing piece, thanks!
Hopefully last (batch of) question(s)
- Is the typing of
SpinePlayerConfig
for v4.0 is correct? All config options are marked as required, so something like this fails the TypeScript check.
- How to automatically starts playing the animation when
showControls
is false
? The following code snippet doesn't start the animation automatically, only if showControls
of the player config is false
:
success: (player) => player.play()
I want to express the gratitude of your responsiveness, thank you for being so responsive!