mapping of massives(react)2019 Community Moderator ElectionHow do I efficiently iterate over each entry in a Java Map?Sort a Map<Key, Value> by valuesPython reverse / invert a mappingHow can I initialise a static Map?What's the difference between ConcurrentHashMap and Collections.synchronizedMap(Map)?Loop inside React JSXWhat is the difference between using constructor vs getInitialState in React / React Native?What do these three dots in React do?Programmatically navigate using react routerWhat is the difference between React Native and React?

How do spaceships determine each other's mass in space?

Why couldn't the separatists legally leave the Republic?

Are small insurances worth it?

Shifting between bemols (flats) and diesis (sharps)in the key signature

In the late 1940’s to early 1950’s what technology was available that could melt a LOT of ice?

Do I really need to have a scientific explanation for my premise?

Power Strip for Europe

What will happen if my luggage gets delayed?

How many characters using PHB rules does it take to be able to have access to any PHB spell at the start of an adventuring day?

When a wind turbine does not produce enough electricity how does the power company compensate for the loss?

How to check whether module is loaded with custom configurations?

Conservation of Mass and Energy

Is a piano played in the same way as a harmonium?

Why is a very small peak with larger m/z not considered to be the molecular ion?

What stops an assembly program from crashing the operating system?

Was it really inappropriate to write a pull request for the company I interviewed with?

Giving a career talk in my old university, how prominently should I tell students my salary?

Which classes are needed to have access to every spell in the PHB?

What would be the most expensive material to an intergalactic society?

Professor forcing me to attend a conference, I can't afford even with 50% funding

Street obstacles in New Zealand

Which situations would cause a company to ground or recall a aircraft series?

After `ssh` without `-X` to a machine, is it possible to change `$DISPLAY` to make it work like `ssh -X`?

What materials can be used to make a humanoid skin warm?



mapping of massives(react)



2019 Community Moderator ElectionHow do I efficiently iterate over each entry in a Java Map?Sort a Map<Key, Value> by valuesPython reverse / invert a mappingHow can I initialise a static Map?What's the difference between ConcurrentHashMap and Collections.synchronizedMap(Map)?Loop inside React JSXWhat is the difference between using constructor vs getInitialState in React / React Native?What do these three dots in React do?Programmatically navigate using react routerWhat is the difference between React Native and React?










0















I have a list of items in the List of catalogue. Every item from ListOfItems should have dropdown ListOfSubItems.



I'm working with reactjs (beginner) so don't know (yet) is there any option to make it beautiful.



Question: How is it possible to reach massive List and its data?



I definitely can reach my goal with pure html and css. But in future, it wouldn't be so nice to support such code.



So I'm trying to do it with map() but supposingly have a stupid mistake still can't find.



So my List of catalogue looks like that one



and my code(for 1 table, just for example):



 const CatalogueListNames = [

catalogueNameType: 'appliance',
catalogueName: 'Бытовая техника',
List: [

itemName: 'Крупногабаритная техника',
itemPath: '/bulkymachines',

subItemPath: '/fridges',
subItemName: 'Холодильники',

subItemPath1: '/freezers',
subItemName1: 'Морозильники',

subItemPath2: '/washmachines',
subItemName2: 'Стиральные машины',

subItemPath3: '/driers',
subItemName3: 'Сушильные машины',

subItemPath4: '/stovehoods',
subItemName4: 'Вытяжки',

subItemPath5: '/cookers',
subItemName5: 'Кухонные плиты',

subItemPath6: '/dishwashers',
subItemName6: 'Посудомоечные машины',

subItemPath7: '/wineracks',
subItemName7: 'Винные шкафы',

,

itemName: 'Крупногабаритная техника',
itemPath: '/bulkymachines',


subItemPath: '/fridges',
subItemName: 'Холодильники',

subItemPath1: '/freezers',
subItemName1: 'Морозильники',

subItemPath2: '/washmachines',
subItemName2: 'Стиральные машины',

subItemPath3: '/driers',
subItemName3: 'Сушильные машины',

subItemPath4: '/stovehoods',
subItemName4: 'Вытяжки',

subItemPath5: '/cookers',
subItemName5: 'Кухонные плиты',

subItemPath6: '/dishwashers',
subItemName6: 'Посудомоечные машины',

subItemPath7: '/wineracks',
subItemName7: 'Винные шкафы',

,

itemName: 'Крупногабаритная техника',
itemPath: '/bulkymachines',


subItemPath: '/fridges',
subItemName: 'Холодильники',

subItemPath1: '/freezers',
subItemName1: 'Морозильники',

subItemPath2: '/washmachines',
subItemName2: 'Стиральные машины',

subItemPath3: '/driers',
subItemName3: 'Сушильные машины',

subItemPath4: '/stovehoods',
subItemName4: 'Вытяжки',

subItemPath5: '/cookers',
subItemName5: 'Кухонные плиты',

subItemPath6: '/dishwashers',
subItemName6: 'Посудомоечные машины',

subItemPath7: '/wineracks',
subItemName7: 'Винные шкафы',

,

itemName: 'Крупногабаритная техника',
itemPath: '/bulkymachines',


subItemPath: '/fridges',
subItemName: 'Холодильники',

subItemPath1: '/freezers',
subItemName1: 'Морозильники',

subItemPath2: '/washmachines',
subItemName2: 'Стиральные машины',

subItemPath3: '/driers',
subItemName3: 'Сушильные машины',

subItemPath4: '/stovehoods',
subItemName4: 'Вытяжки',

subItemPath5: '/cookers',
subItemName5: 'Кухонные плиты',

subItemPath6: '/dishwashers',
subItemName6: 'Посудомоечные машины',

subItemPath7: '/wineracks',
subItemName7: 'Винные шкафы',

,

itemName: 'Крупногабаритная техника',
itemPath: '/bulkymachines',


subItemPath: '/fridges',
subItemName: 'Холодильники',

subItemPath1: '/freezers',
subItemName1: 'Морозильники',

subItemPath2: '/washmachines',
subItemName2: 'Стиральные машины',

subItemPath3: '/driers',
subItemName3: 'Сушильные машины',

subItemPath4: '/stovehoods',
subItemName4: 'Вытяжки',

subItemPath5: '/cookers',
subItemName5: 'Кухонные плиты',

subItemPath6: '/dishwashers',
subItemName6: 'Посудомоечные машины',

subItemPath7: '/wineracks',
subItemName7: 'Винные шкафы',

,

itemName: 'Крупногабаритная техника',
itemPath: '/bulkymachines',


subItemPath: '/fridges',
subItemName: 'Холодильники',

subItemPath1: '/freezers',
subItemName1: 'Морозильники',

subItemPath2: '/washmachines',
subItemName2: 'Стиральные машины',

subItemPath3: '/driers',
subItemName3: 'Сушильные машины',

subItemPath4: '/stovehoods',
subItemName4: 'Вытяжки',

subItemPath5: '/cookers',
subItemName5: 'Кухонные плиты',

subItemPath6: '/dishwashers',
subItemName6: 'Посудомоечные машины',

subItemPath7: '/wineracks',
subItemName7: 'Винные шкафы',

,
],
,
];


and here



 const Catalogue = () => 
return (
<div className="CatalogueFull">
<div className='CatalogueItem'>

CatalogueListNames.map((itemData, index) =>
return (
<CatalogueName
key=index
type=itemData.catalogueNameType>itemData.catalogueName</CatalogueName>
)
).itemData.List.map((List, index) =>
return (
<CatalogueItemsList
key=index
itemName=List.itemName
itemPath=List.itemPath
subItemPath=List.subItemPath
subItemName=List.subItemName
subItemPath1=List.subItemPath1
subItemName1=List.subItemName1
subItemPath2=List.subItemPath2
subItemName2=List.subItemName2
subItemPath3=List.subItemPath3
subItemName3=List.subItemName3
subItemPath4=List.subItemPath4
subItemName4=List.subItemName4
subItemPath5=List.subItemPath5
subItemName5=List.subItemName5
subItemPath6=List.subItemPath6
subItemName6=List.subItemName6
subItemPath7=List.subItemPath7
subItemName7=List.subItemName7
/>
)
)


</div>
</div>
)
;

export default Catalogue;


I know something wrong is going with massive CatalogueListNames and List is inside. Also I'm not sure about second map() (is it even legit to use 2 map()'s in one row?) 1st map() is working. Second is not.










share|improve this question



















  • 2





    2 maps is fine. Create sub arrays, and store name/path in those. Absolutely avoid what you're doing. It's an eye sore, and will be a pain to debug/add new items.

    – FrankerZ
    Mar 6 at 14:50















0















I have a list of items in the List of catalogue. Every item from ListOfItems should have dropdown ListOfSubItems.



I'm working with reactjs (beginner) so don't know (yet) is there any option to make it beautiful.



Question: How is it possible to reach massive List and its data?



I definitely can reach my goal with pure html and css. But in future, it wouldn't be so nice to support such code.



So I'm trying to do it with map() but supposingly have a stupid mistake still can't find.



So my List of catalogue looks like that one



and my code(for 1 table, just for example):



 const CatalogueListNames = [

catalogueNameType: 'appliance',
catalogueName: 'Бытовая техника',
List: [

itemName: 'Крупногабаритная техника',
itemPath: '/bulkymachines',

subItemPath: '/fridges',
subItemName: 'Холодильники',

subItemPath1: '/freezers',
subItemName1: 'Морозильники',

subItemPath2: '/washmachines',
subItemName2: 'Стиральные машины',

subItemPath3: '/driers',
subItemName3: 'Сушильные машины',

subItemPath4: '/stovehoods',
subItemName4: 'Вытяжки',

subItemPath5: '/cookers',
subItemName5: 'Кухонные плиты',

subItemPath6: '/dishwashers',
subItemName6: 'Посудомоечные машины',

subItemPath7: '/wineracks',
subItemName7: 'Винные шкафы',

,

itemName: 'Крупногабаритная техника',
itemPath: '/bulkymachines',


subItemPath: '/fridges',
subItemName: 'Холодильники',

subItemPath1: '/freezers',
subItemName1: 'Морозильники',

subItemPath2: '/washmachines',
subItemName2: 'Стиральные машины',

subItemPath3: '/driers',
subItemName3: 'Сушильные машины',

subItemPath4: '/stovehoods',
subItemName4: 'Вытяжки',

subItemPath5: '/cookers',
subItemName5: 'Кухонные плиты',

subItemPath6: '/dishwashers',
subItemName6: 'Посудомоечные машины',

subItemPath7: '/wineracks',
subItemName7: 'Винные шкафы',

,

itemName: 'Крупногабаритная техника',
itemPath: '/bulkymachines',


subItemPath: '/fridges',
subItemName: 'Холодильники',

subItemPath1: '/freezers',
subItemName1: 'Морозильники',

subItemPath2: '/washmachines',
subItemName2: 'Стиральные машины',

subItemPath3: '/driers',
subItemName3: 'Сушильные машины',

subItemPath4: '/stovehoods',
subItemName4: 'Вытяжки',

subItemPath5: '/cookers',
subItemName5: 'Кухонные плиты',

subItemPath6: '/dishwashers',
subItemName6: 'Посудомоечные машины',

subItemPath7: '/wineracks',
subItemName7: 'Винные шкафы',

,

itemName: 'Крупногабаритная техника',
itemPath: '/bulkymachines',


subItemPath: '/fridges',
subItemName: 'Холодильники',

subItemPath1: '/freezers',
subItemName1: 'Морозильники',

subItemPath2: '/washmachines',
subItemName2: 'Стиральные машины',

subItemPath3: '/driers',
subItemName3: 'Сушильные машины',

subItemPath4: '/stovehoods',
subItemName4: 'Вытяжки',

subItemPath5: '/cookers',
subItemName5: 'Кухонные плиты',

subItemPath6: '/dishwashers',
subItemName6: 'Посудомоечные машины',

subItemPath7: '/wineracks',
subItemName7: 'Винные шкафы',

,

itemName: 'Крупногабаритная техника',
itemPath: '/bulkymachines',


subItemPath: '/fridges',
subItemName: 'Холодильники',

subItemPath1: '/freezers',
subItemName1: 'Морозильники',

subItemPath2: '/washmachines',
subItemName2: 'Стиральные машины',

subItemPath3: '/driers',
subItemName3: 'Сушильные машины',

subItemPath4: '/stovehoods',
subItemName4: 'Вытяжки',

subItemPath5: '/cookers',
subItemName5: 'Кухонные плиты',

subItemPath6: '/dishwashers',
subItemName6: 'Посудомоечные машины',

subItemPath7: '/wineracks',
subItemName7: 'Винные шкафы',

,

itemName: 'Крупногабаритная техника',
itemPath: '/bulkymachines',


subItemPath: '/fridges',
subItemName: 'Холодильники',

subItemPath1: '/freezers',
subItemName1: 'Морозильники',

subItemPath2: '/washmachines',
subItemName2: 'Стиральные машины',

subItemPath3: '/driers',
subItemName3: 'Сушильные машины',

subItemPath4: '/stovehoods',
subItemName4: 'Вытяжки',

subItemPath5: '/cookers',
subItemName5: 'Кухонные плиты',

subItemPath6: '/dishwashers',
subItemName6: 'Посудомоечные машины',

subItemPath7: '/wineracks',
subItemName7: 'Винные шкафы',

,
],
,
];


and here



 const Catalogue = () => 
return (
<div className="CatalogueFull">
<div className='CatalogueItem'>

CatalogueListNames.map((itemData, index) =>
return (
<CatalogueName
key=index
type=itemData.catalogueNameType>itemData.catalogueName</CatalogueName>
)
).itemData.List.map((List, index) =>
return (
<CatalogueItemsList
key=index
itemName=List.itemName
itemPath=List.itemPath
subItemPath=List.subItemPath
subItemName=List.subItemName
subItemPath1=List.subItemPath1
subItemName1=List.subItemName1
subItemPath2=List.subItemPath2
subItemName2=List.subItemName2
subItemPath3=List.subItemPath3
subItemName3=List.subItemName3
subItemPath4=List.subItemPath4
subItemName4=List.subItemName4
subItemPath5=List.subItemPath5
subItemName5=List.subItemName5
subItemPath6=List.subItemPath6
subItemName6=List.subItemName6
subItemPath7=List.subItemPath7
subItemName7=List.subItemName7
/>
)
)


</div>
</div>
)
;

export default Catalogue;


I know something wrong is going with massive CatalogueListNames and List is inside. Also I'm not sure about second map() (is it even legit to use 2 map()'s in one row?) 1st map() is working. Second is not.










share|improve this question



















  • 2





    2 maps is fine. Create sub arrays, and store name/path in those. Absolutely avoid what you're doing. It's an eye sore, and will be a pain to debug/add new items.

    – FrankerZ
    Mar 6 at 14:50













0












0








0








I have a list of items in the List of catalogue. Every item from ListOfItems should have dropdown ListOfSubItems.



I'm working with reactjs (beginner) so don't know (yet) is there any option to make it beautiful.



Question: How is it possible to reach massive List and its data?



I definitely can reach my goal with pure html and css. But in future, it wouldn't be so nice to support such code.



So I'm trying to do it with map() but supposingly have a stupid mistake still can't find.



So my List of catalogue looks like that one



and my code(for 1 table, just for example):



 const CatalogueListNames = [

catalogueNameType: 'appliance',
catalogueName: 'Бытовая техника',
List: [

itemName: 'Крупногабаритная техника',
itemPath: '/bulkymachines',

subItemPath: '/fridges',
subItemName: 'Холодильники',

subItemPath1: '/freezers',
subItemName1: 'Морозильники',

subItemPath2: '/washmachines',
subItemName2: 'Стиральные машины',

subItemPath3: '/driers',
subItemName3: 'Сушильные машины',

subItemPath4: '/stovehoods',
subItemName4: 'Вытяжки',

subItemPath5: '/cookers',
subItemName5: 'Кухонные плиты',

subItemPath6: '/dishwashers',
subItemName6: 'Посудомоечные машины',

subItemPath7: '/wineracks',
subItemName7: 'Винные шкафы',

,

itemName: 'Крупногабаритная техника',
itemPath: '/bulkymachines',


subItemPath: '/fridges',
subItemName: 'Холодильники',

subItemPath1: '/freezers',
subItemName1: 'Морозильники',

subItemPath2: '/washmachines',
subItemName2: 'Стиральные машины',

subItemPath3: '/driers',
subItemName3: 'Сушильные машины',

subItemPath4: '/stovehoods',
subItemName4: 'Вытяжки',

subItemPath5: '/cookers',
subItemName5: 'Кухонные плиты',

subItemPath6: '/dishwashers',
subItemName6: 'Посудомоечные машины',

subItemPath7: '/wineracks',
subItemName7: 'Винные шкафы',

,

itemName: 'Крупногабаритная техника',
itemPath: '/bulkymachines',


subItemPath: '/fridges',
subItemName: 'Холодильники',

subItemPath1: '/freezers',
subItemName1: 'Морозильники',

subItemPath2: '/washmachines',
subItemName2: 'Стиральные машины',

subItemPath3: '/driers',
subItemName3: 'Сушильные машины',

subItemPath4: '/stovehoods',
subItemName4: 'Вытяжки',

subItemPath5: '/cookers',
subItemName5: 'Кухонные плиты',

subItemPath6: '/dishwashers',
subItemName6: 'Посудомоечные машины',

subItemPath7: '/wineracks',
subItemName7: 'Винные шкафы',

,

itemName: 'Крупногабаритная техника',
itemPath: '/bulkymachines',


subItemPath: '/fridges',
subItemName: 'Холодильники',

subItemPath1: '/freezers',
subItemName1: 'Морозильники',

subItemPath2: '/washmachines',
subItemName2: 'Стиральные машины',

subItemPath3: '/driers',
subItemName3: 'Сушильные машины',

subItemPath4: '/stovehoods',
subItemName4: 'Вытяжки',

subItemPath5: '/cookers',
subItemName5: 'Кухонные плиты',

subItemPath6: '/dishwashers',
subItemName6: 'Посудомоечные машины',

subItemPath7: '/wineracks',
subItemName7: 'Винные шкафы',

,

itemName: 'Крупногабаритная техника',
itemPath: '/bulkymachines',


subItemPath: '/fridges',
subItemName: 'Холодильники',

subItemPath1: '/freezers',
subItemName1: 'Морозильники',

subItemPath2: '/washmachines',
subItemName2: 'Стиральные машины',

subItemPath3: '/driers',
subItemName3: 'Сушильные машины',

subItemPath4: '/stovehoods',
subItemName4: 'Вытяжки',

subItemPath5: '/cookers',
subItemName5: 'Кухонные плиты',

subItemPath6: '/dishwashers',
subItemName6: 'Посудомоечные машины',

subItemPath7: '/wineracks',
subItemName7: 'Винные шкафы',

,

itemName: 'Крупногабаритная техника',
itemPath: '/bulkymachines',


subItemPath: '/fridges',
subItemName: 'Холодильники',

subItemPath1: '/freezers',
subItemName1: 'Морозильники',

subItemPath2: '/washmachines',
subItemName2: 'Стиральные машины',

subItemPath3: '/driers',
subItemName3: 'Сушильные машины',

subItemPath4: '/stovehoods',
subItemName4: 'Вытяжки',

subItemPath5: '/cookers',
subItemName5: 'Кухонные плиты',

subItemPath6: '/dishwashers',
subItemName6: 'Посудомоечные машины',

subItemPath7: '/wineracks',
subItemName7: 'Винные шкафы',

,
],
,
];


and here



 const Catalogue = () => 
return (
<div className="CatalogueFull">
<div className='CatalogueItem'>

CatalogueListNames.map((itemData, index) =>
return (
<CatalogueName
key=index
type=itemData.catalogueNameType>itemData.catalogueName</CatalogueName>
)
).itemData.List.map((List, index) =>
return (
<CatalogueItemsList
key=index
itemName=List.itemName
itemPath=List.itemPath
subItemPath=List.subItemPath
subItemName=List.subItemName
subItemPath1=List.subItemPath1
subItemName1=List.subItemName1
subItemPath2=List.subItemPath2
subItemName2=List.subItemName2
subItemPath3=List.subItemPath3
subItemName3=List.subItemName3
subItemPath4=List.subItemPath4
subItemName4=List.subItemName4
subItemPath5=List.subItemPath5
subItemName5=List.subItemName5
subItemPath6=List.subItemPath6
subItemName6=List.subItemName6
subItemPath7=List.subItemPath7
subItemName7=List.subItemName7
/>
)
)


</div>
</div>
)
;

export default Catalogue;


I know something wrong is going with massive CatalogueListNames and List is inside. Also I'm not sure about second map() (is it even legit to use 2 map()'s in one row?) 1st map() is working. Second is not.










share|improve this question
















I have a list of items in the List of catalogue. Every item from ListOfItems should have dropdown ListOfSubItems.



I'm working with reactjs (beginner) so don't know (yet) is there any option to make it beautiful.



Question: How is it possible to reach massive List and its data?



I definitely can reach my goal with pure html and css. But in future, it wouldn't be so nice to support such code.



So I'm trying to do it with map() but supposingly have a stupid mistake still can't find.



So my List of catalogue looks like that one



and my code(for 1 table, just for example):



 const CatalogueListNames = [

catalogueNameType: 'appliance',
catalogueName: 'Бытовая техника',
List: [

itemName: 'Крупногабаритная техника',
itemPath: '/bulkymachines',

subItemPath: '/fridges',
subItemName: 'Холодильники',

subItemPath1: '/freezers',
subItemName1: 'Морозильники',

subItemPath2: '/washmachines',
subItemName2: 'Стиральные машины',

subItemPath3: '/driers',
subItemName3: 'Сушильные машины',

subItemPath4: '/stovehoods',
subItemName4: 'Вытяжки',

subItemPath5: '/cookers',
subItemName5: 'Кухонные плиты',

subItemPath6: '/dishwashers',
subItemName6: 'Посудомоечные машины',

subItemPath7: '/wineracks',
subItemName7: 'Винные шкафы',

,

itemName: 'Крупногабаритная техника',
itemPath: '/bulkymachines',


subItemPath: '/fridges',
subItemName: 'Холодильники',

subItemPath1: '/freezers',
subItemName1: 'Морозильники',

subItemPath2: '/washmachines',
subItemName2: 'Стиральные машины',

subItemPath3: '/driers',
subItemName3: 'Сушильные машины',

subItemPath4: '/stovehoods',
subItemName4: 'Вытяжки',

subItemPath5: '/cookers',
subItemName5: 'Кухонные плиты',

subItemPath6: '/dishwashers',
subItemName6: 'Посудомоечные машины',

subItemPath7: '/wineracks',
subItemName7: 'Винные шкафы',

,

itemName: 'Крупногабаритная техника',
itemPath: '/bulkymachines',


subItemPath: '/fridges',
subItemName: 'Холодильники',

subItemPath1: '/freezers',
subItemName1: 'Морозильники',

subItemPath2: '/washmachines',
subItemName2: 'Стиральные машины',

subItemPath3: '/driers',
subItemName3: 'Сушильные машины',

subItemPath4: '/stovehoods',
subItemName4: 'Вытяжки',

subItemPath5: '/cookers',
subItemName5: 'Кухонные плиты',

subItemPath6: '/dishwashers',
subItemName6: 'Посудомоечные машины',

subItemPath7: '/wineracks',
subItemName7: 'Винные шкафы',

,

itemName: 'Крупногабаритная техника',
itemPath: '/bulkymachines',


subItemPath: '/fridges',
subItemName: 'Холодильники',

subItemPath1: '/freezers',
subItemName1: 'Морозильники',

subItemPath2: '/washmachines',
subItemName2: 'Стиральные машины',

subItemPath3: '/driers',
subItemName3: 'Сушильные машины',

subItemPath4: '/stovehoods',
subItemName4: 'Вытяжки',

subItemPath5: '/cookers',
subItemName5: 'Кухонные плиты',

subItemPath6: '/dishwashers',
subItemName6: 'Посудомоечные машины',

subItemPath7: '/wineracks',
subItemName7: 'Винные шкафы',

,

itemName: 'Крупногабаритная техника',
itemPath: '/bulkymachines',


subItemPath: '/fridges',
subItemName: 'Холодильники',

subItemPath1: '/freezers',
subItemName1: 'Морозильники',

subItemPath2: '/washmachines',
subItemName2: 'Стиральные машины',

subItemPath3: '/driers',
subItemName3: 'Сушильные машины',

subItemPath4: '/stovehoods',
subItemName4: 'Вытяжки',

subItemPath5: '/cookers',
subItemName5: 'Кухонные плиты',

subItemPath6: '/dishwashers',
subItemName6: 'Посудомоечные машины',

subItemPath7: '/wineracks',
subItemName7: 'Винные шкафы',

,

itemName: 'Крупногабаритная техника',
itemPath: '/bulkymachines',


subItemPath: '/fridges',
subItemName: 'Холодильники',

subItemPath1: '/freezers',
subItemName1: 'Морозильники',

subItemPath2: '/washmachines',
subItemName2: 'Стиральные машины',

subItemPath3: '/driers',
subItemName3: 'Сушильные машины',

subItemPath4: '/stovehoods',
subItemName4: 'Вытяжки',

subItemPath5: '/cookers',
subItemName5: 'Кухонные плиты',

subItemPath6: '/dishwashers',
subItemName6: 'Посудомоечные машины',

subItemPath7: '/wineracks',
subItemName7: 'Винные шкафы',

,
],
,
];


and here



 const Catalogue = () => 
return (
<div className="CatalogueFull">
<div className='CatalogueItem'>

CatalogueListNames.map((itemData, index) =>
return (
<CatalogueName
key=index
type=itemData.catalogueNameType>itemData.catalogueName</CatalogueName>
)
).itemData.List.map((List, index) =>
return (
<CatalogueItemsList
key=index
itemName=List.itemName
itemPath=List.itemPath
subItemPath=List.subItemPath
subItemName=List.subItemName
subItemPath1=List.subItemPath1
subItemName1=List.subItemName1
subItemPath2=List.subItemPath2
subItemName2=List.subItemName2
subItemPath3=List.subItemPath3
subItemName3=List.subItemName3
subItemPath4=List.subItemPath4
subItemName4=List.subItemName4
subItemPath5=List.subItemPath5
subItemName5=List.subItemName5
subItemPath6=List.subItemPath6
subItemName6=List.subItemName6
subItemPath7=List.subItemPath7
subItemName7=List.subItemName7
/>
)
)


</div>
</div>
)
;

export default Catalogue;


I know something wrong is going with massive CatalogueListNames and List is inside. Also I'm not sure about second map() (is it even legit to use 2 map()'s in one row?) 1st map() is working. Second is not.







arrays reactjs dictionary






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 6 at 14:53









Treycos

4,47321433




4,47321433










asked Mar 6 at 14:44









HumechHumech

31




31







  • 2





    2 maps is fine. Create sub arrays, and store name/path in those. Absolutely avoid what you're doing. It's an eye sore, and will be a pain to debug/add new items.

    – FrankerZ
    Mar 6 at 14:50












  • 2





    2 maps is fine. Create sub arrays, and store name/path in those. Absolutely avoid what you're doing. It's an eye sore, and will be a pain to debug/add new items.

    – FrankerZ
    Mar 6 at 14:50







2




2





2 maps is fine. Create sub arrays, and store name/path in those. Absolutely avoid what you're doing. It's an eye sore, and will be a pain to debug/add new items.

– FrankerZ
Mar 6 at 14:50





2 maps is fine. Create sub arrays, and store name/path in those. Absolutely avoid what you're doing. It's an eye sore, and will be a pain to debug/add new items.

– FrankerZ
Mar 6 at 14:50












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55025779%2fmapping-of-massivesreact%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55025779%2fmapping-of-massivesreact%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

1928 у кіно

Захаров Федір Захарович

Ель Греко