Skip to content

Commit 2de4bd0

Browse files
Copilotabernier
andcommitted
Add TypeScript types to SayCheese and use React.useEffect
Co-authored-by: abernier <[email protected]>
1 parent 0632ef7 commit 2de4bd0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

.storybook/Setup.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import * as React from 'react'
44
import { Vector3 } from 'three'
55
import { Canvas, CanvasProps, useThree } from '@react-three/fiber'
66
import isChromatic from 'chromatic/isChromatic'
7-
import { useEffect } from 'react'
87

98
import { OrbitControls } from '../src'
109

@@ -48,10 +47,10 @@ export const Setup = ({
4847
/**
4948
* A helper component to pause the frameloop at a consistent time for snapshots
5049
*/
51-
function SayCheese({ pauseAt = 3000 }) {
50+
function SayCheese({ pauseAt = 3000 }: { pauseAt?: number }) {
5251
const { clock, advance, setFrameloop, invalidate, gl, scene, camera } = useThree()
5352

54-
useEffect(() => {
53+
React.useEffect(() => {
5554
// console.log(`😬 Say cheeese (pausing at ${pauseAt}ms)`)
5655

5756
// Pause the frameloop immediately (chromatic.delay handles asset loading wait)

0 commit comments

Comments
 (0)