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

202
Views
Intenté alternar el botón de alarma al botón marcado para la tarea objetivo, pero no funciona

Intenté alternar el botón de alarma para verificar el botón de la tarea objetivo, pero el ícono de alarma de todas las tareas también cambió. Estoy usando el kit de herramientas redux

este es mi estado

 const initialState = { isHideForm: false, taskDesc: "", date: "", time: "", user: "", taskTitle: "", isEditing: false, editID: null, isCompleted: false, data: [], };

Aquí está el reductor para alternar el botón.

 completed(state, action) { let item = state.data.find((x) => x.id === action.payload); if (item) { state.isCompleted = !state.isCompleted; } },

Este es el botón de clic

 <button onClick={(e) => handleCompleted(e, d.id)} className="border-y-2 border-r-2 border-gray-200 p-2 rounded-r"> {isCompleted ? <GrCheckmark /> : <FaBell />} </button>
about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Tienes que devolver un nuevo objeto de estado

 if(item) { return {...state, isCompleted: !state.isCompleted } }
about 4 years ago · Santiago Trujillo 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!