Skip to content

Extend the SliderItem type for value to include React.ReactNode #117

@tlehtimaki

Description

@tlehtimaki

Problem or feature description:

Extend the SliderItem type for value to include React.ReactNode.

Would be usefull for situatiations like this

<Handle
   {...hanleProps}
    handle={{
        ...handle,
         value: (
            <div
                role="button"
                tabIndex={0}
                style={{ whiteSpace: 'pre' }}
                onMouseUp={disableTimeSelectionChange}
                onMouseDown={enableTimeSelectionChange}
             >
                  {formatTime(time.selected)}
                  {formatDate(time.selected)}
             </div>
         )
    }}
/>

How change would look

From this:

export interface SliderItem {
id: string;
value: number;
percent: number;
}

.. to this:

export interface SliderItem {
  id: string;
  value: number | React.ReactNode;
  percent: number;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions