materialize-css react code example
Example 1: react materilize
npm install materialize-css@next
npm install react-materialize
Example 2: materialize css for react
npm install materialize-css
Example 3: using materialize css with react
import React from 'react';
import M from 'materialize-css';
....
class SomeComponent extends Component {
componentDidMount(){
M.Sidenav.init(this.sidenav);
}
render(){
return (
<ul className={this.props.classes}
ref={ (sidenav) => {this.sidenav = sidenav} }
id={this.props.id}>
</ul>
)
}
}