How to use pseudo selectors in material-ui?

后端 未结 3 1952
一整个雨季
一整个雨季 2021-02-11 14:19

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:25

    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"
        }
      }
    }));
    

提交回复
热议问题