I have a parent class which will pass props to a component class. These props are arrays {door, window, carpet, curtain} which I have imported from my ProductInformation.js
I seem to have solved my problem of my props not being defined. My logic was that I pass <ProductSquare arrayId = {door}/> which would be the array name and than the I would call this.props.arrayId.map get error of undefined because {door} was obviously undefined.
I solved it by importing my data into my parent class and passing the individual arrays itself to child component class.
My question: Is this a efficient way to pass array data like this; is there a better logic?
import {door, window, carpet, curtain} from './ProductInformation2.js'
<Tabs forceRenderTabPanel>
<TabList>
<Tab>Front</Tab>
<Tab>Rear</Tab>
<Tab>Side</Tab>
</TabList>
<TabPanel>
<div className = 'tabAreaSelected'>
<ProductSquare arrayId = {curtain}/>
<ProductSquare arrayId = {door}/>
<ProductSquare arrayId = {window}/>
<ProductSquare arrayId = {carpet}/>
</div>
</Tabs>
Here is my previous question
<ProductSquare />is or if it's getting only the data it cares about.