Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tlehtimaki opened this issue Jun 9, 2020 · 0 comments
Open

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

tlehtimaki opened this issue Jun 9, 2020 · 0 comments

Comments

@tlehtimaki
Copy link

tlehtimaki commented Jun 9, 2020

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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant