Skip to content

Commit

Permalink
type declaration - fix missing children prop (#819)
Browse files Browse the repository at this point in the history
* 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<SplitPane> & { css?: Interpolation<Theme>; } & Pick<...> & InexactPartial<...> & InexactPartial<...>'.
  Property 'children' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<SplitPane> & { css?: Interpolation<Theme>; } & Pick<...> & InexactPartial<...> & InexactPartial<...>'.ts(2322)
```

* make children prop optional
  • Loading branch information
ellanan authored Aug 22, 2022
1 parent 95f8c65 commit 49c6d36
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export type SplitPaneProps = {
pane2Style?: React.CSSProperties;
resizerClassName?: string;
step?: number;
children?: React.ReactNode;
};

export type SplitPaneState = {
Expand Down

0 comments on commit 49c6d36

Please sign in to comment.