diff --git a/src/hooks/useRive.tsx b/src/hooks/useRive.tsx
index 70f4af3..5448b03 100644
--- a/src/hooks/useRive.tsx
+++ b/src/hooks/useRive.tsx
@@ -29,6 +29,7 @@ function RiveComponent({
const containerStyle = {
width: '100%',
height: '100%',
+ overflow: 'hidden',
...style,
};
diff --git a/test/useRive.test.tsx b/test/useRive.test.tsx
index f342420..b30b12f 100644
--- a/test/useRive.test.tsx
+++ b/test/useRive.test.tsx
@@ -428,6 +428,7 @@ describe('useRive', () => {
);
expect(container.firstChild).not.toHaveStyle('width: 50%');
+ expect(container.firstChild).not.toHaveStyle('overflow: hidden');
});
it('has a canvas size of 0 by default', async () => {
@@ -454,6 +455,7 @@ describe('useRive', () => {
const { RiveComponent: RiveTestComponent } = result.current;
const { container } = render();
expect(container.querySelector('canvas')).toHaveStyle('width: 0');
+ expect(container.firstChild).toHaveStyle('overflow: hidden');
});
it('sets the canvas width and height after calculating the container size', async () => {