Storybookk page reloads when the package in the parent changes

This commit is contained in:
Lance
2025-04-24 22:55:47 -06:00
committed by Lance Snider
parent 5354d1f69b
commit 7277ed2f0d
9 changed files with 7520 additions and 113 deletions

View File

@@ -0,0 +1,32 @@
import React from 'react';
import { useRive } from '@rive-app/react-canvas';
type User = {
name: string;
};
export interface HeaderProps {
user?: User;
onLogin?: () => void;
onLogout?: () => void;
onCreateAccount?: () => void;
}
export const RiveThing = ({
user,
onLogin,
onLogout,
onCreateAccount,
}: HeaderProps) => {
const { RiveComponent } = useRive({
src: 'https://cdn.rive.app/animations/vehicles.riv',
stateMachines: 'bumpy',
autoplay: true,
});
return (
<header className="header">
<RiveComponent />
</header>
);
};