I have parent component ComponentTableCustom which is drawing tables according to given props. Also I have prop columnsNaryad which is array of objects. As a child CN has search field with button. How can I redraw CTC on this button click and get info from field?
What I have now:
export const columnsNaryad = [
{
title: 'Title',
dataIndex: 'naryad_NomerNaryada',
sorter: true,
filter: '',
children: [
{
title: (
<Input.Search
style={{ width: "100%" }}
onSearch={nameSearch => {
console.log(nameSearch)
console.log(columnsNaryad)
columnsNaryad[0].filter = nameSearch
}}
/>
),
dataIndex: 'naryad_NomerNaryada',
width: 130,
}
]
},
{...}]
And App:
<Route path="/naryad">
<ComponentTableCustom
dataSource={naryad}
setDataSource={setDataSourceEdinicy}
columns={columnsNaryad}
page={"naryad"}
rowSelection
/>
</Route>
As a variant there is use-deep-compare-effect but that is not the best choise I think.