styled components conditional hover

Solutions on MaxInterview for styled components conditional hover by the best coders in the world

showing results for - "styled components conditional hover"
Carl
29 Jan 2020
1import { css, styled } from 'styled-components'
2
3styled.div`
4   ${props => props.shouldHover && css`
5      &:hover {
6        background: 'red';
7      }
8   `}
9`
10