split-pane-react icon indicating copy to clipboard operation
split-pane-react copied to clipboard

Typescript: Property 'sashRender' is missing in type

Open jabidof opened this issue 3 years ago • 3 comments

Property 'sashRender' is missing in type '{ children: Element[]; sizes: (string | number)[]; onChange: Dispatch<SetStateAction<(string | number)[]>>; }' but required in type 'ISplitProps'.ts(2741)

I suppose you should accept undefined for sashRender. Had to add sashRender={() => null} to make TS accept it.

Thanks for the good job! Nice lib handling the border cases nicely!

jabidof avatar Dec 17 '22 14:12 jabidof

Property 'sashRender' is missing in type '{ children: Element[]; sizes: (string | number)[]; onChange: Dispatch<SetStateAction<(string | number)[]>>; }' but required in type 'ISplitProps'.ts(2741)

I suppose you should accept undefined for sashRender. Had to add sashRender={() => null} to make TS accept it.

Thanks for the good job! Nice lib handling the border cases nicely!

Thank you for your advice. I have a lot to do recently. If you are in a hurry to use it, you can propose a merge, or I will fix the TS problem later next week.

yyllff avatar Dec 17 '22 14:12 yyllff

No hurry... that can be solved anytime soon. I found a fix already but once fixed in TS your library quality will improve 😊

jabidof avatar Dec 17 '22 17:12 jabidof

same here

i add the code , it work now:

...
  <SplitPane
        
          sashRender={(_, active) => (
            <SashContent active={active} type="vscode" />
          )}
        
        >
...

give a default value to the sashRender

shifenhutu avatar Dec 19 '22 11:12 shifenhutu