Estas usando un mismo state para todo, y cuando filtras se pierden el resto de valores. Podrías tener un objeto como state, con tres propiedades, y que el valor de cada una sea un array: all, completed, active, e ir actualizando la data que corresponda según la acción del usuario. Y vas a necesitar otro state que se actualice cuando se presione en alguno de los filtros. Para renderear por ejemplo: data[currentProp], donde currentProp va a ser el nombre de alguna de las propiedades del objeto. Y un consejo, mantené el mismo idioma en el código, lo ideal sería hacerlo todo en inglés. Espero haberte ayudado!
Marked as helpful
@JoaquinWald
Posted
@abrahamemamani Muchas gracias por tu respuesta Abraham! Voy a ponerme manos a la obra y modificar las cosas como indicas. Un abrazo.