Answer the question
In order to leave comments, you need to log in
How to call different methods in two modules using a wrapper component over table (antd) when clicking on a table row?
Hello.
Please tell me how to make it so that when you click on a table row (a wrapper over table from antd) in each component (for example: the table of orders and the table of buyers) its own method is called? I read about the onRow parameter of the table, it seems to be what I need, but I'm not catching up ( Let's say I
use the openModal parameter to pass the function, I write in props in the wrapper component
And here I get stuck with this id: number. Let's say this id is passed in the user table But in the table of orders, you need to pass the user id and, for example, the date of the order.To do this, props should be like this:
Then the following follows in the text (again, only suitable for the users table):
openModal?: (id: number) => void,
openModal?: (id: number, date: string) => void,
const onRow = (record: { id: number }) => ({
onClick: () => {
if (openModal) {
openModal(record.id);
}
},
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question