Skip to content

Commit fe88a0d

Browse files
committed
Use the types, Luke
1 parent d48e48b commit fe88a0d

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

source/Uncontrolled.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react'
2-
import { Controlled, ControlledProps } from './Controlled'
2+
import { Controlled, type ControlledProps } from './Controlled'
33

44
// =============================================================================
55

@@ -9,10 +9,9 @@ export type UncontrolledProps =
99
export function Uncontrolled ({ onZoomChange, ...props }: UncontrolledProps) {
1010
const [isZoomed, setIsZoomed] = React.useState(false)
1111

12-
const handleZoomChange = React.useCallback((
13-
value: boolean,
14-
{ event }: { event: React.SyntheticEvent | Event }
15-
) => {
12+
const handleZoomChange = React.useCallback<
13+
NonNullable<ControlledProps['onZoomChange']>
14+
>((value, { event }) => {
1615
setIsZoomed(value)
1716
onZoomChange?.(value, { event })
1817
}, [onZoomChange])

stories/Img.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { Meta } from '@storybook/react-webpack5'
33

44
import { waitFor, within, userEvent, expect } from 'storybook/test'
55

6-
import Zoom, { UncontrolledProps } from '../source'
6+
import Zoom, { type UncontrolledProps } from '../source'
77
import '../source/styles.css'
88
import './base.css'
99

0 commit comments

Comments
 (0)