How to use pseudo selectors in material-ui?

后端 未结 3 808
天命终不由人
天命终不由人 2021-02-11 14:48

I have been trying to achieve the simple thing. I was trying to show/hide my component in the material UI v1 with pseudo selectors but somehow it

3条回答
  •  醉话见心
    2021-02-11 15:07

    Just adding with Jorge Santos Neil, you don't necessarily need to use props. I am adding one of the example that is tested for a different scenario. A note is that, this needs to be included in "makeStyles" and then used as a "className". Simply putting it inside "styles={{}}" does not work.

    Example:

    const useStyles = makeStyles((theme) => ({
      paragraphWithWarningDiv: {
        margin: "32px 0px 24px",
        "& :nth-child(1)": {
          marginBottom: "100px"
        }
      }
    }));
    

提交回复
热议问题