refactor: remove extra children

This commit is contained in:
Enix 2019-09-05 09:47:12 +08:00
parent 637365dcf3
commit 00f5217f87
No known key found for this signature in database
GPG key ID: FE06F5DFC1C9B8E4

View file

@ -11,11 +11,7 @@ type Props = {
children(size: Partial<Size>): React.ReactNode
} & React.HTMLAttributes<HTMLElement>
export default function SizeObserver({
type = 'div',
children,
...rest
}: React.PropsWithChildren<Props>) {
export default function SizeObserver({ type = 'div', children, ...rest }: Props) {
const ref = React.useRef<any>()
const [size, setSize] = React.useState<Partial<Size>>({