Skip to content

Repository files navigation

@codewell/component-map

Installation

npm install @codewell/component-map

Basic Usage

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}/>

About

Higher order React component that maps out other components.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages