React does not recognize the `inputRef` prop on a DOM element
See original GitHub issueWhen 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:
- Created 2 years ago
- Reactions:10
- Comments:11
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
upvote the fix by @enricomad https://github.com/mac-s-g/react-json-view/pull/374 🆙
@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