styled components :hover with react-native and react-native-web

i'm using styled-components in react-native app lets say i have Link component:

import styled from 'styled-components/native';

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

  &:hover {
    color: 'blue';
  }
`

then i 'compile' my RN code with react-native-web

all is great expect that hover is not working (text color remains red on hover)

my guess is that https://github.com/styled-components/css-to-react-native is removing the hover definition

any idea how to fix this?

You can use onMouseEnter and onMouseLeave like in the refs section of styled-components. Advanced guide.

Comments

Popular posts from this blog

Meaning of `{}` for return expression

Get current scroll position of ScrollView in React Native

flutter websocket connection issue