Answers for "materialize css can be used in react"

CSS
1

materialize css for react

//to use materialize css in react js

npm install materialize-css
Posted by: Guest on June-25-2020
0

using materialize css with react

import React from 'react';
import M from 'materialize-css';
....
// ref can only be used on class components
class SomeComponent extends Component {
  // get a reference to the element after the component has mounted
  componentDidMount(){
    M.Sidenav.init(this.sidenav);
  }

  render(){
    return (
      <ul className={this.props.classes}
          ref={ (sidenav) => {this.sidenav = sidenav} }
          id={this.props.id}>
        // menuItems
      </ul>
    )
  }
}
Posted by: Guest on September-11-2020

Code answers related to "materialize css can be used in react"

Browse Popular Code Answers by Language