Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

138
Views
styled(Component) no aplica estilos en el componente funcional

1 . Tengo un componente que está escrito con componentes con estilo

2 . Llamar a ese componente dentro del nuevo componente Styled

3 . Adjuntar estilos

Resultado : los estilos no se aplican

 export const WarningBox = styled(InfoBox)` ${({ theme }) => css` display: flex; flex-direction: row; align-items: flex-start; font-size: 12px; padding: 16px; border-radius: 4px; background-color: ${theme.colors.yellow[150]}; border: 1px solid ${theme.colors.yellow[700]}; a { font-family: Montserrat; font-weight: 500; color: ${theme.colors.blue[900]}; margin-right: 15px; } `}} `;

Este es InfoBox que quiero personalizar:

 const Container = styled.div` ${({ theme }) => css` padding: 16px; width: 100%; min-height: 110px; border-radius: 4px; background-color: ${theme.colors.green[150]}; `}} `; ...rest of the styled-components... type InfoBoxProps = { title?: string; text?: string; icon?: React.ReactNode; }; export const InfoBox: FC<InfoBoxProps> = ({ title = '', text = '', icon, children, }) => ( <Container className="box-container"> <Text>{text}</Text> {children} </Container> );
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Debe pasar el accesorio className de InfoBox a su contenedor; de lo contrario, no se aplicarán los estilos:

 type InfoBoxProps = { className?: string; title?: string; text?: string; icon?: React.ReactNode; }; export const InfoBox: FC<InfoBoxProps> = ({ className, title = '', text = '', icon, children, }) => ( <Container className={`box-container ${className}`}> <Text>{text}</Text> {children} </Container> );
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!