The problem is in mixing React and jQuery. The fetch is fine and your React state is updated just fine. Its the jQuery code thats the problem. What is the jQuery code even supposed to do? You dont need any of it, just remove all the jquery and datatables.net (wth is that?) and it will work great!
datatable.net is a js library to display data in a form resembling data grid or table. From what I know, it still uses jQuery; hence jQuery is required for that.
For OP, I recommend to use either ag-Grid community edition ([(ag-grid.com/]) or Tabulator ([(tabulator.info/]) which I used in my last project. These two libs don't use jQuery.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Top comments (2)
The problem is in mixing React and jQuery. The fetch is fine and your React state is updated just fine. Its the jQuery code thats the problem. What is the jQuery code even supposed to do? You dont need any of it, just remove all the jquery and datatables.net (wth is that?) and it will work great!
datatable.net is a js library to display data in a form resembling data grid or table. From what I know, it still uses jQuery; hence jQuery is required for that.
For OP, I recommend to use either ag-Grid community edition ([(ag-grid.com/]) or Tabulator ([(tabulator.info/]) which I used in my last project. These two libs don't use jQuery.