A
A
Arthur2019-09-03 19:43:41
React
Arthur, 2019-09-03 19:43:41

How to pass a component on the basis of which the drawing will be to another component?

Hey!
Tell me how is this done correctly?
There is, for example, a table component (divided into a header and a body component).
A Row component that only renders plain text data.
A RowSpecial component that renders complex data, with buttons, editable fields, etc.
How to correctly pass the component in which you want to draw data to the table body?
i.e. I want to do this

<Table>
  <TableHeader columns={columns} />
  <TableBody rowComponent={RowSpecial} data={data} />
</Table>

and in the Row/RowSpecial component describe the data rendering logic

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2019-09-03
@cloudz

For example

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question