Это прекрасно работает:
const Cool = styled.div` background: blue; `
Как нам это сделать:
const Sweet = styled('cool-sweet')` background: blue; `
const Cool = styled.div` background: blue; ` const Sweet = styled(Cool)` \\override <Cool/> background: red; `
Это должно сработать.
import React from 'react'; import styled from 'styled-components'; const Sweet = styled(({ children, ...rest }) => ( <cool-sweet {...rest}>{children}</cool-sweet> ))` background: blue; `;