I'm tried to create Ant design 4 input search to filter data , Name and age, when i search name or age wanna display table data but its not working anyone know how to do that correctly
stazkblitz here
code here
const columns = [
{
title: "Name",
dataIndex: "name",
key: "name",
render: text => <a>{text}</a>
},
{
title: "Age",
dataIndex: "age",
key: "age"
}
];
const data = [
{
key: "1",
name: "John Brown",
age: 32
},
{
key: "2",
name: "Jim Green",
age: 42
},
{
key: "3",
name: "Joe Black",
age: 32
}
];
const onSearch = value => console.log(value);
ReactDOM.render(
<div><Search
placeholder="input search text"
allowClear
enterButton="Search"
size="large"
onSearch={onSearch}
/>
<br/>
<br/> <br/>
<Table columns={columns} dataSource={data} /></div>,
document.getElementById('container')
);
Thanks
question from:
https://stackoverflow.com/questions/65850635/react-ant-design-4-input-search-display-table-data 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…