Answer the question
In order to leave comments, you need to log in
How to search by children in a component?
Hello colleagues :)
I need your help again. I started making a tab+page component. We make a layout like this:
<MyPages>
<page>
<tab>Заголовок вкладки</tab>
<content>текст при активной вкладке</content>
</page>
<page>
<tab>Заголовок вкладки</tab>
<content>текст при активной вкладке</content>
</page>
</MyPages>
Answer the question
In order to leave comments, you need to log in
There is a *React.Children.map* method for such purposes, although there is a possible solution
<MyPages>
<Page tab={} content={} />
<Page tab={} content={} />
<MyPages/>
pages = [
{tab='Заголовок вкладки', content='текст при активной вкладке'},
{tab='Заголовок вкладки', content='текст при активной вкладке'}
]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question