react-data-table-component
react-data-table-component copied to clipboard
Issues with types
Issue Check list
- [x] Agree to the Code of Conduct
- [x] Read the README
- [x] You are using React 16.8.0+
- [x] You installed
styled-components
- [x] Include relevant code or preferably a code sandbox
Describe the bug
When upgrading to 7.6.2 from 7.2.1, the DataTable no longer renders.
To Reproduce
Steps to reproduce the behavior:
- Upgrade to 7.6.2
- View any page with DataTable present
- See Error in console
Warning: React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: object.
Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.
Expected behavior
No error and page renders
Code Sandbox, Screenshots, or Relevant Code
I was able to replicate in Codepen but I got a different error:
https://codepen.io/TigerWolf/pen/NWQpxpj
TypeError: l.current is null
useState React
fo index.es.js:383
Ro index.es.js:383
This even happens if I just use the example code from the documentation
import DataTable from 'react-data-table-component';
const columns = [
{
name: 'Title',
selector: row => row.title,
},
{
name: 'Year',
selector: row => row.year,
},
];
const data = [
{
id: 1,
title: 'Beetlejuice',
year: '1988',
},
{
id: 2,
title: 'Ghostbusters',
year: '1984',
},
]
function MyComponent() {
return (
<DataTable
columns={columns}
data={data}
/>
);
};
Versions (please complete the following information)
- React 18.3.1
- Styled Components 6.1.13
- OS: OSX and Linux
- Browser - Chrome and Firefox