npm install @codewell/component-map
importComponentMapfrom'@codewell/component-map';constFoo=({ name, commonProp1 })=>(<div>{name} foo - {commonProp1}</div>);<ComponentMap// Component that should be mappedcomponent={Foo}// Array with properties for each// mapped childdata={[{name: "hello"},{name: "world"}]}// Common properties shared among all// the children e.g. state, dispatch// and callback functions like onClickcommonProperties={{commonProp1: "commonProp1",}}// Each react child should have a unique// key propkeyFunction={(props,index)=>props.name}/>