Skip to content

Commit

Permalink
fix: fix crash when specifying prop loop as undefined (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
hannojg authored May 5, 2024
1 parent 6965c3c commit 4c31058
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package/src/SkottieView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export type SkottieViewProps = NativeSkiaViewProps & {

/**
* A boolean flag indicating whether or not the animation should loop.
* @default false
*/
loop?: boolean;

Expand Down Expand Up @@ -195,7 +196,7 @@ export const Skottie = React.forwardRef<SkottieViewRef, SkottieViewProps>(
// Toggle loop mode
useEffect(() => {
assertSkiaViewApi();
SkiaViewApi.setJsiProperty(nativeId, 'loop', props.loop);
SkiaViewApi.setJsiProperty(nativeId, 'loop', Boolean(props.loop));
}, [nativeId, props.loop]);
//#endregion

Expand Down

0 comments on commit 4c31058

Please sign in to comment.