How to access a DOM element in React? What is the equilvalent of document.getElementById() in React

前端 未结 4 1829
面向向阳花
面向向阳花 2020-11-22 05:34

How do I select certain bars in react.js?

This is my code:

var Progressbar = React.createClass({
    getInitialState: function () {
        return {          


        
4条回答
  •  萌比男神i
    2020-11-22 06:16

    For getting the element in react you need to use ref and inside the function you can use the ReactDOM.findDOMNode method.

    But what I like to do more is to call the ref right inside the event

     this.myTextInput = ref} />
    

    This is some good link to help you figure out.

提交回复
热议问题