material-ui-repeatable
Repeat any component as many times as you like on the page.
Single TextField
Multiple TextField's
Installation
yarn add material-ui-repeatable
Or with npm
npm i --save material-ui-repeatable
Usage example
import React Component from 'react';import Repeatable from 'material-ui-repeatable';{;thisstate =copies: 1;}<div =>hello I am replicant index</div>{console;this;}{console;this;}{return<Repeatable====/>;}
Properties
For snackbar props please see material-ui docs.
Name | Type | Default | Description |
---|---|---|---|
initialCopies | number |
1 |
Number of the replicants to be generated at the render time. |
requiredCopies | number |
1 |
Number of the replicants that should be persist(remove control will hide when this value is reached). |
childrenRenderer | function |
(index) => [] |
A function that returns a new replicant. |
onAdd | function |
(index) => undefined |
Function that will be invoked after some replicant added. |
onRemove | function |
(index) => undefined |
Function that will be invoked after some replicant removed. |
style | object |
{} |
Style of the component container. |