How to get rid of underline for Link component of React Router?

后端 未结 17 2558
独厮守ぢ
独厮守ぢ 2020-12-23 00:16

I have the following:

How do I get rid of the blue underline? The code is below:



        
17条回答
  •  旧巷少年郎
    2020-12-23 00:38

    Look here -> https://material-ui.com/guides/composition/#button.

    This is the official material-ui guide. Maybe it'll be useful to you as it was for me.

    However, in some cases, underline persists and you may want to use text-decoration: "none" for that. For a more cleaner approach, you can import and use makeStyles from material-ui/core.

    import { makeStyles } from '@material-ui/core';
    
    const useStyles = makeStyles(() => ({
        menu-btn: {
            textDecoration: 'none',
        },
    }));
    
    const classes = useStyles();
    

    And then set className attribute to {classes.menu-btn} in your JSX code.

提交回复
热议问题