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

What's the meaning of useSlider's prop 'styles' with the type CSSProperties #2508

Open
rocketlyz opened this issue Jul 9, 2023 · 0 comments

Comments

@rocketlyz
Copy link

What is the current behavior?
I'm confused about the usage of styles prop in useSlider.
Code at: https://github.com/streamich/react-use/blob/master/src/useSlider.ts#L16.
src/useSlider.ts

//  type declared
export interface Options {
  ...
  styles: boolean | CSSProperties;
}

// only used as a judge

const styles = options.styles === undefined ? true : options.styles;

if (ref.current && styles) {
  ref.current.style.userSelect = 'none';
}

As shown in the above code, could anyone tell me why CSSProperties are used ?

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