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

160
Views
Estoy usando componentes con estilo y quiero usar onClick en el div con estilo pero no funciona

Estoy usando componentes con estilo y quiero usar onClick en el div con estilo pero no funciona. ¡Intenté usar div normal y funcionó! ¿Puede alguien ayudarme? ¡Los fragmentos están abajo!

KindOfShootLayout es mi componente con estilo

 <KindOfShootLayout onClick={() => gib()}> {type.name} <i className={type.icon}></i> </KindOfShootLayout>

Mi función gib()

 const gib =()=>{ alert('hi') }

KindOfShootLayout.js

 import React from 'react'; import styled from 'styled-components'; const Container = styled.div` background: ${props => props.primary ? "pink" : "palevioletred"}; color:${props => props.primary ? "white" : "palevioletred"}; height: 15vh; width: 22vw; vertical-align: baseline; text-align:center; vertical-align: middle; text-transform: uppercase; font-size: 20px; backdrop-filter: blur(16px) saturate(180%); -webkit-backdrop-filter: blur(16px) saturate(180%); background-color: rgba(255, 255, 255, 0.75); padding: 2px; border: 2px dashed rgba(209, 213, 219, 0.3); :hover{ background: ${props => props.primary ? "white" : "red"}; color: white; cursor: pointer; font-weight: 900; } @media (max-width: 1140px) { vertical-align: middle; width: 50vw; height: 10vh; text-align: center; margin-left: 5%; }

` ;

exportar por defecto ({hijos}) => {hijos};

about 4 years ago · Juan Pablo Isaza
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!