A
A
Andrew Johnson2021-06-17 19:03:16
React
Andrew Johnson, 2021-06-17 19:03:16

How to wrap another component with your component?

There is a functional component Cell. Inside it is a component with text. There are several such Cell components.

So how do I create it so that other components can be nested in it? I want to set a class in the Cell component 1 time so that I don’t have to constantly prescribe it.

60cb72318417c512399334.jpeg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Suntsev, 2021-06-17
@GreyCrew

export const CustomCell = ({children}) => {
    return <Cell>{children}</Cell>
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question