The new react-router syntax uses the Link
component to move around the routes. But how could this be integrated with material-ui
?
In my cas
My instructor helped me with using React Router 4.0's withRouter to wrap the Tabs component to enable history methods like so:
import React, {Component} from "react";
import {Tabs, Tab} from 'material-ui';
import { withRouter } from "react-router-dom";
import Home from "./Home";
import Portfolio from "./Portfolio";
class NavTabs extends Component {
handleCallToRouter = (value) => {
this.props.history.push(value);
}
render () {
return (
)
}
}
export default withRouter(NavTabs)
Simply add BrowserRouter to index.js and you're good to go.