javascript - How do I convert jQuery code in my React Component? -


i need update css, , naturally used jquery, i'm told not use jquery react.

how properly. can add more code if needed. i'm toggling bottom border of div

  togglemarker () {     if (this.state.previous && (this.state.current !== this.state.previous)) {       $('#nav_' + this.state.previous).css("border-bottom", '');     }     if (this.state.previous !== this.state.current) {       $('#nav_' + this.state.current).css("border-bottom", this.color);     }     this.setstate({previous: this.state.current});   } 

you can manipulate components style inline , can give conditions according state variables.

example

 render(){     return(         <div style={{ borderbottom: ((this.state.previous && (this.state.current !== this.state.previous)) ? 'none' : 1) }}>             // ...         </div>    ) } 

Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -