小编Dáv*_*ika的帖子

样式组件:使用 react-native 和 react-native-web 悬停

styled-components在 React-Native App 中使用。假设我有链接组件:

import styled from 'styled-components/native';

const Link = styled.Text`
  color: 'red';

  &:hover {
    color: 'blue';
  }
`
Run Code Online (Sandbox Code Playgroud)

之后,我使用react-native-web 来“编译”我的 React-Native 代码。

一切都很好,希望悬停不起作用。(文本颜色保持red悬停。)

我的猜测是https://github.com/styled-components/css-to-react-native正在删除hover定义。

知道如何解决这个问题吗?

javascript reactjs react-native styled-components react-native-web

7
推荐指数
2
解决办法
1万
查看次数