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

SplitPane, sashRender prop required?

Open Yoorana opened this issue 1 year ago • 1 comments

Hey first time starting my own project, I started using SplitPane for a simple vertical pane from the storybook reference only sizes and onChange seems to be used as props This example here

As prop seems sashRender is also required, why is that? Could I get some help on this?

This is what I have written


      <SplitPane
        sizes={sizes}
        onChange={setSizes}
      >
        <Pane
          className="emptyInvoiceView"
          style={{ background: "grey", height: "100%" }}
          minSize="10%"
        >
          <CreateEmptyInvoiceView />
        </Pane>
      </SplitPane>

Error message is

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

Yoorana avatar Apr 27 '24 21:04 Yoorana

You can add sashRender={() => null} below the onChange to satisfy the requirement:

     <SplitPane
        sizes={sizes}
        onChange={setSizes}
        sashRender={() => null}
      >
        <Pane
          className="emptyInvoiceView"
          style={{ background: "grey", height: "100%" }}
          minSize="10%"
        >
          <CreateEmptyInvoiceView />
        </Pane>
      </SplitPane>

jmather-aipm avatar Jun 17 '24 19:06 jmather-aipm