1

I am using react-data-table-components and just following the instruction given by the documentation but it's show me an error

error

below is the sample code the i copied in the documentation

import DataTable from 'react-data-table-component';

const App = () => {

  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',
      },
  ]

  return (
    <>
        <DataTable
            columns={columns}
            data={data}
        />
    </>
  )
}

export default App

below is the package.json

package.json

these are the error showing in my console

StyledComponent.ts:159 styled-components: it looks like an unknown prop "responsive" is being sent through to the DOM, which will likely trigger a React console error. If you would like automatic filtering of unknown props, you can opt-into that behavior via <StyleSheetManager shouldForwardProp={...}> (connect an API like @emotion/is-prop-valid) or consider using transient props ($ prefix for automatic filtering.)

react-dom.development.js:86 Warning: React does not recognize the sortActive prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase sortactive instead. If you accidentally passed it from a parent component, remove it from the DOM element.

react-dom.development.js:86 Warning: Received false for a non-boolean attribute dense.

react-dom.development.js:86 Warning: React does not recognize the fixedHeader prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase fixedheader instead. If you accidentally passed it from a parent component, remove it from the DOM element.

RJM
  • 11
  • 2
  • put error on words – Script Host Aug 12 '23 at 02:36
  • I just did sir, that is all the error i was getting – RJM Aug 12 '23 at 03:06
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Aug 13 '23 at 21:16
  • The code is correct. What happens is that ``react-data-table-component`` is using an old version of ``styled-components``. So, to remove the errors downgrade ``styled-components`` to v5.3.3. Also, there's a PR on ``react-data-table-component`` repository for this problem, but it hasn't been merged yet. – aldwinp35 Aug 20 '23 at 02:16

0 Answers0