Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

135
Vistas
react-data-table-component - Checkboxes won't stay checked

I am having a problem in react-data-table-component where the checkboxes in my datatable don't remain "checked".

I do see there is indication the check occurred but not seeing it remaining checked: Alt Text

It's weird, right? Why is that happening?

Here's my code:

             <DataTable
                 title={ `Items` }
                 columns={ columns }
                 data={ filteredItems }
                 pagination
                 paginationResetDefaultPage={ resetPaginationToggle_users }
                 subHeader
                 onRowClicked={ handleRowClicked }
                 selectableRows
                 selectableRowsComponent={Checkbox} // Pass the function only
                 selectableRowsComponentProps={selectProps}
                 onSelectedRowsChange={ handleSelectedRows }
                 responsive
                 expandableRows
                 expandOnRowClicked
                 expandableRowsHideExpander
                 expandableRowsComponent={ <UpdateItemComponent data={ mainData } s={ s } setS={ setS } /> }
                 persistTableHead
             />

Perhaps it's something to do with selectableRowsComponent and Checkbox?

Here's how that is being brought into this code:


    const Checkbox = React.forwardRef(({ onClick, ...rest }, ref) =>
    {
     return(
         <>
             <div className="form-check pb-5" style={{ backgroundColor: '' }}>
                 <input 
                     type="checkbox"
                     className="form-check-input"
                     style={{ height: '20px', width: '20px' }}
                     ref={ref}
                     onClick={ onClick }
                     {...rest}
                 />
                 <label className="form-check-label" id="booty-check" />
             </div>
         </>
     )
    })

I am trying to have the checkboxes remain checked.

How to do it?

about 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda