react-data-table-component icon indicating copy to clipboard operation
react-data-table-component copied to clipboard

Console Warning: Received `true` for a non-boolean attribute `center`.

Open seriseyes opened this issue 2 years ago • 1 comments

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 sortActive prop on a DOM element
  • Warning: Received true for a non-boolean attribute center.

To Reproduce

Steps to reproduce the behavior:

  1. Go to React component that used react-data-table-component
  2. 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:

image image image

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

seriseyes avatar Nov 17 '23 03:11 seriseyes

This is the same comment as on: https://github.com/jbetancur/react-data-table-component/issues/1161

anders2410 avatar Jan 19 '24 12:01 anders2410