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

131
Views
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
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!