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

141
Views
¿Hay alguna manera de vincular mi clasificación solo cuando se hace clic en la casilla de verificación?

Estoy aprendiendo a reaccionar y estoy tratando de ordenar y filtrar una lista para mostrarla en un sitio web. Creé una función de clasificación, por ejemplo, y usé Formgroups para mis casillas de verificación. No entiendo cómo puedo vincular las casillas de verificación y hacer que funcionen solo cuando se ha hecho clic en las casillas. `const [cantidad más alta, establecer cantidad más alta] = estado de uso (falso); //hacer una lista vacía que luego se completará cuando cambie el estado

 const [highestAmount, setHighestAmount] = useState(false); //make an empty list that then will be populated when the state changes const sortHighestAmount = list.sort(function (a, b) { return a.amount - b.amount; }).reverse(); console.log(sortHighestAmount); const [lowestAmount, setLowestAmount] = useState(false); const sortHighestAmount = (event) => { console.log(event.target.value); const Highest = list.sort(function (a, b) { return a.amount - b.amount; }); }

<FormControlLabel control={<Checkbox checked={highestAmount} onChange={(event) => setHighestAmount(event.target.checked)} inputProps={{ 'aria-label': 'controlled' }} />} label="Highest Amount" />

 <FormControlLabel control={<Checkbox checked={lowestAmount} onChange={(event) => setLowestAmount(event.target.checked)} inputProps={{ 'aria-label': 'controlled' }} />} label="Lowest Amount" />

`

Estoy tratando de filtrar a través de una lista. He escrito un código de clasificación, pero me resulta un poco difícil hacer un estado useHandle o cualquier otro enlace que pueda ayudarme a clasificar la lista.

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!