March 2019
Intermediate to advanced
534 pages
14h 52m
English
When you use react-router as the router for your application, you can render links using the Link component from react-router-dom. Since you want to render Material-UI buttons in order to get the consistent Material-UI theme and user interaction behavior, you can't render Link components directly. Instead, you can make the underlying Button component a Link component, as follows:
<Button component={Link} to="/"> Home</Button>
By using the component property, you can tell the Button component to apply styles and event handling logic to this component instead of the default. Then, any additional properties that you would normally pass to Link are set on the Button component—which forwards them to Link. For example, the to property ...
Read now
Unlock full access