Skip to content

module which creates needed amount of copies of passed component

License

Notifications You must be signed in to change notification settings

iron66/copy_component

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Installation

Using npm:

$ npm install copy-component -S

Using yarn:

$ yarn add copy-component

Usage with React

(Sandbox link)[https://codesandbox.io/s/busy-hoover-miqdw?file=/src/Rating.jsx]

<Copy amount={5}>
    {idx => (
        <input
            type="checkbox"
            checked={isHighlighted(idx)}
            onMouseOver={() => setRating(idx + 1)}
            onMouseLeave={() => setRating(value)}
            onClick={() => set(idx + 1)}
        />
    )}
</Copy>

About

module which creates needed amount of copies of passed component

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages