question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

React does not recognize the `inputRef` prop on a DOM element

See original GitHub issue

When I try to use react-json-view to render expandable row in a functional component in a table I get this error when I use onEdit method

React does not recognize the inputRef prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase inputref instead. If you accidentally passed it from a parent component, remove it from the DOM element

code

import { Table } from 'antd';

const columns = [
  {
    title: 'ID',
    dataIndex: 'id',
  }
];

<Table
  rowKey="id"
  columns={columns}
  dataSource={data}
  expandable={{
    expandedRowRender: (record) => (
      <ExpandedRow record={record} />
    ),
  }}
/>;

//ExpandedRow child component

import { FC } from 'react';
import ReactJson from 'react-json-view';

interface IExpandedRow {
  record: any;
}

const ExpandedRow: FC<IExpandedRow> = ({ record, ...rest }: IExpandedRow) => {
  const onEdit = (data: any) => {
    console.log(data);
  };

  return (
    <>
      <ReactJson
        {...rest}
        onEdit={onEdit}
        src={record}
      />
    </>
  );
};

export default ExpandedRow;

I tried to create ref and pass it to ExpandedRow component but I got the same error, am I doing something wrong here ?

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:10
  • Comments:11

github_iconTop GitHub Comments

2reactions
dranitskicommented, Dec 13, 2021
1reaction
enricomadcommented, Dec 7, 2021

@kulabros the issue is triggered by newer versions of react (compared to demo code), which the lib is not compatible with anymore. more details in #347

Read more comments on GitHub >

github_iconTop Results From Across the Web

React does not recognize the `inputRef` prop on a DOM ...
Here is the warning I am getting any time I am using a MaskedInput Warning: React does not recognize the inputRefprop on a...
Read more >
React does not recognize the `InputProps` prop on a DOM ...
The problem is with your InputProps object, according to the documentation, it uses an object , you didn't pass a proper object to...
Read more >
Unknown Prop Warning - React
The unknown-prop warning will fire if you attempt to render a DOM element with a prop that is not recognized by React as...
Read more >
React does not recognize the `inputRef` prop on a DOM element
I got this warning: warning.js:33 Warning: React does not recognize the `inputRef` prop on a DOM element. If you intentionally want it to...
Read more >
react does not recognize the input type prop on a dom element
Warning : React does not recognize the inputRefprop on a DOM element. ... to appear in the DOM as a custom attribute, spell...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found