react-component / slider

React Slider
https://slider.react-component.now.sh/
MIT License
3.03k stars 767 forks source link

Component doesn't show up at all #606

Open seta-namle opened 4 years ago

seta-namle commented 4 years ago

Hi guys, thank you for giving us an awesome React library. While trying to use your Slider in my project, I ran into an issue of visibility. Here is my code

import React from 'react';
import Slider, { Range } from 'rc-slider';
import 'rc-slider/assets/index.css';

class MyComponent extends React.Component {
    render() {
        return (
            <div>
                <Slider
                    min={0}
                    max={20}
                    defaultValue={3}
                />
                <Range
                    min={0}
                    max={20}
                    defaultValue={[3, 10]}
                    tipFormatter={value => `${value}`}
                />
             </div>
       )
     }
  }
export default MyComponent

It's very similar with #317 but importing css file didn't help. I tried to reproduce it on codesandbox but I couldn't. I use your library with material-ui verison 1.0.0, React v 16.8.1 and React DOM v 16.3.0 Thank you very much!

seta-namle commented 4 years ago

I think I get the root cause of this issue. Although I import 'rc-slider/assets/index.css', the style doesn't apply to my code. I tried taking the css from rc-slider/assets/index.css to my inline-style and it did improve but it was quite difficult to know what style apply for what. I will keep it update if I have any progress.