react-data-table-component
react-data-table-component copied to clipboard
Console Warning: Received `true` for a non-boolean attribute `center`.
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
Printing unwanted warning on console. Such as:
- Warning: React does not recognize the
sortActiveprop on a DOM element - Warning: Received
truefor a non-boolean attributecenter.
To Reproduce
Steps to reproduce the behavior:
- Go to React component that used react-data-table-component
- Check browser console
Expected behavior
Should not print warning
Code Sandbox, Screenshots, or Relevant Code
The Code:
import React from 'react'
import ReactDOM from 'react-dom/client'
import DataTable from 'react-data-table-component';
ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<MyComponent/>
</React.StrictMode>,
)
interface Type {
id: number;
title: string;
year: string;
}
const columns = [
{name: 'Title', selector: (row: Type) => row.title,},
{name: 'Year', selector: (row: Type) => row.year,},
];
const data: Type[] = [
{id: 1, title: 'Beetlejuice', year: '1988',},
{id: 2, title: 'Ghostbusters', year: '1984',},
]
function MyComponent() {
return <DataTable
columns={columns}
data={data}
/>
}
The Warning:
Versions (please complete the following information)
"dependencies": {
"react": "^18.2.0",
"react-data-table-component": "^7.5.4",
"react-dom": "^18.2.0",
"styled-components": "^6.1.1"
},
"devDependencies": {
"@types/react": "^18.2.37",
"@types/react-dom": "^18.2.15",
"@typescript-eslint/eslint-plugin": "^6.10.0",
"@typescript-eslint/parser": "^6.10.0",
"@vitejs/plugin-react": "^4.2.0",
"eslint": "^8.53.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.4",
"typescript": "^5.2.2",
"vite": "^5.0.0"
}
- OS: Windows 10, Windows 11, Manjaro Linux
- Browser chrome, firefox, opera, basically all major browser, and they are all on latest version
This is the same comment as on: https://github.com/jbetancur/react-data-table-component/issues/1161