Skip to content

Latest commit

 

History

History
29 lines (24 loc) · 519 Bytes

README.md

File metadata and controls

29 lines (24 loc) · 519 Bytes

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>