From 49c6d3655a2828f906e3ba5e4c204bbd46a649d0 Mon Sep 17 00:00:00 2001 From: Ella Nan <38847123+ellanan@users.noreply.github.com> Date: Mon, 22 Aug 2022 09:16:46 -0600 Subject: [PATCH] type declaration - fix missing `children` prop (#819) * fix missing `children` prop React 18's types are more strict and the missing `children` prop results in this typescript error being thrown when using the component ``` Type '{ children: Element[]; css: SerializedStyles; split: "vertical"; minSize: number; maxSize: number; onDragStarted: () => void; onDragFinished: (newSize: number) => void; size: number; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & { css?: Interpolation; } & Pick<...> & InexactPartial<...> & InexactPartial<...>'. Property 'children' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & { css?: Interpolation; } & Pick<...> & InexactPartial<...> & InexactPartial<...>'.ts(2322) ``` * make children prop optional --- index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/index.d.ts b/index.d.ts index d116f54d..93290945 100644 --- a/index.d.ts +++ b/index.d.ts @@ -25,6 +25,7 @@ export type SplitPaneProps = { pane2Style?: React.CSSProperties; resizerClassName?: string; step?: number; + children?: React.ReactNode; }; export type SplitPaneState = {