5

I am truing to use noUiSlider in my react application. I have done the initialization in my componentDidMount method but noUiSlider is not visibble. I am not getting any error in console. The element list also shows that nouislider is present on page, but I cannot see it.

import noUiSlider from 'nouislider'


class AppBarComponent extends Component {
componentDidMount(){

    var noUi_slider = document.getElementById('noUiSlider');

    $(function () {

    noUiSlider.create(noUi_slider, {
        start: [20, 80],
        connect: true,
        range: {
            'min': 0,
            'max': 100
        }
    });
}

componentWillUnmount(){}


render() {
    return (

        <div>
        <div id="noUiSlider" className="bg-success"></div>
        </div>
);
}
};
EdG
  • 2,243
  • 6
  • 48
  • 103

1 Answers1

-2

Your first arg to create is "noUi_slider" but your div id is "noUiSlider" Spell these exactly the same.

Nisarg Shah
  • 14,151
  • 6
  • 34
  • 55
user1343035
  • 245
  • 3
  • 13