如何使用 MUI 和 Typescript 同时触发 Typography 和 StyledTextField 的悬停效果

问题描述 投票:0回答:0
 <Typography 
        id = "first_text"
        sx= {{
          fontWeight: "regular", 
          fontSize: "18px", 
          marginTop: "-4px", 
          marginLeft: "8px", 
          color: "#888",
          '&:hover': {
            color: "#252525"
         },
         }}>
         First Name*
        </Typography>
<StyledTextField..... (didn't put the whole code here but you get the picture, haha)>

我尝试将所有内容放在一个盒子中,并向该盒子添加悬停状态,也许我做错了,但它不起作用。我看到有人问了类似的问题,但我是 MUI 新手,不太确定如何使用它。

material-ui hover react-typescript
© www.soinside.com 2019 - 2024. All rights reserved.