Búsqueda de sitios web

reactjs - Breakpoint de styled-components personalizado `El elemento de enlace 'theme' tiene implícitamente un tipo 'any'`


Creé funciones auxiliares de "breakpoints" con styled-components que se ven así:

type Props = Record<string, unknown>
type Interpolators<P extends Props> =
  | SimpleInterpolation[]
  | Array<Interpolation<ThemedStyledProps<Props, Theme>>>
  | Array<Interpolation<ThemedStyledProps<P, Theme>>>

export const xs = <T extends Props>(
  strings: TemplateStringsArray,
  ...values: Interpolators<T>
) => css`
  @media screen and (min-width: ${breakpoints.xs}px) {
  ${css(strings, ...values)}
}`

Esto solía funcionar perfectamente, pero con TS v4.1x estoy recibiendo el siguiente error cuando intento acceder al tema o a cualquier otra propiedad dentro de la función xs:

Binding element 'theme' implicitly has an 'any' type. TS7031

Así es como lo estoy usando:

export const Container = styled.div`
  height: ${NAVBAR_HEIGHT}px;
  border-bottom: 2px solid ${({ theme }) => theme.colors.borderSecondary};
  padding: 0px 1rem;
  box-sizing: border-box;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: ${({ theme }) => theme.colors.containerPrimary};

  ${xs`
    background-color: ${({ theme }) => theme.colors.borderSecondary}; // This is where it fails
  `}
`