zillow / react-slider

Accessible, CSS agnostic, slider component for React.
https://zillow.github.io/react-slider
MIT License
892 stars 231 forks source link

broken out of the box? #69

Closed foodaka closed 8 years ago

foodaka commented 8 years ago

Is there something im doing wrong? the component wont render

import React from 'react'; import ReactDOM from 'react-dom'; import ReactSlider from 'react-slider';

const DepthMeterInput = React.createClass({

render() { return (

blahahh
);

} })

export default DepthMeterInput

foodaka commented 8 years ago

i dont know why but it doesnt show my return

  <div>
    <ReactSlider defaultValue={50} />
    blahahh
  </div>
istrel commented 8 years ago

@foodaka For now react slider is a non-es6 module, so you should use CommonJS require call or import this with * like this:

import React from 'react';
import ReactDOM from 'react-dom';
import * as ReactSlider  from 'react-slider';

const DepthMeterInput = React.createClass({
  render() {
    <div>
      <ReactSlider defaultValue={50} />
      blahahh
    </div>
  }
})

export default DepthMeterInput;
kunokdev commented 7 years ago

@foodaka it seems that it doesn't work even with your workaround?

VanDavv commented 7 years ago

@foodaka @istrel this issue is still present, workaround doesn't word, should be reopened!

istrel commented 7 years ago

@VanDavv DId you try to use CommonJS require? It should work with webpack:

import React from 'react';
import ReactDOM from 'react-dom';
const ReactSlider = require('react-slider');

const DepthMeterInput = React.createClass({
  render() {
    <div>
      <ReactSlider defaultValue={50} />
      blahahh
    </div>
  }
})

export default DepthMeterInput;
VanDavv commented 7 years ago

Yes, and I still didn't manage to see the slider. Sorry, but i ended up using rc-slider

sckoh commented 7 years ago

im unable to see the slider too

nigelrobbins3 commented 7 years ago

The slider is hidden by default. The divs are there with the right classes, but without CSS rules they are empty. Hopefully it's just a matter of adding the CSS you want.