N
N
Nikita Andreevich2021-10-01 11:05:22
React
Nikita Andreevich, 2021-10-01 11:05:22

How to select multiple objects dynamically?

const Slug =
        [
            {title: "тест", column:[
                {id: 0, subtitle: "О тест", urlColumn:[
                    {linktitle: 'Тестовое название', link: "yandex.ru"}
                ]},
                {id: 1, subtitle: "тест", urlColumn:[
                    {linktitle: 'Тестовое название', link: "yandex.ru"}
                ]},
                {id: 2, subtitle: "тест", urlColumn:[
                    {linktitle: 'Тестовое название', link: "yandex.ru"}
                ]},
                {id: 3, subtitle: "Исполнение", urlColumn:[
                    {linktitle: 'Тестовое название', link: "yandex.ru"}
                ]},
            ]},
          ]



{Slug.map((subItem) => 
<SubNavItem key={subItem.title}  subtitle={Slug[0].column('subtitle')} linktitle={Slug[1].column[3].urlColumn[0].linktitle} link={Slug[1].column[3].urlColumn[0].link}/>
                        )}

I can't figure out how to pull out values ​​from const when there are a lot of them and they are nested. Statically it turns out, but then the whole meaning is lost

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel Shvedov, 2021-10-01
@terronex

Need another nested map over column array

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question