diff --git a/docs/advanced-customization.md b/docs/advanced-customization.md index 69ec69fef3..3983c1f567 100644 --- a/docs/advanced-customization.md +++ b/docs/advanced-customization.md @@ -112,6 +112,7 @@ The following props are part of each element in `items`: - `hasRemove`: A boolean value stating whether the array item can be removed. - `hasToolbar`: A boolean value stating whether the array item has a toolbar. - `index`: A number stating the index the array item occurs in `items`. +- `key`: A stable, unique key for the array item. - `onDropIndexClick: (index) => (event) => void`: Returns a function that removes the item at `index`. - `onReorderClick: (index, newIndex) => (event) => void`: Returns a function that swaps the items at `index` with `newIndex`. - `readonly`: A boolean value stating if the array item is read-only. diff --git a/package-lock.json b/package-lock.json index f6a474b48f..d45e72d66e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8170,6 +8170,11 @@ "dev": true, "optional": true }, + "nanoid": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-2.0.3.tgz", + "integrity": "sha512-NbaoqdhIYmY6FXDRB4eYtDVC9Z9eCbn8TyaiC16LNKtpPv/aqa0tOPD8y6gNE4yUNnaZ7LLhYtXOev/6+cBtfw==" + }, "nanomatch": { "version": "1.2.13", "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", @@ -10729,6 +10734,11 @@ "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.8.6.tgz", "integrity": "sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA==" }, + "react-lifecycles-compat": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz", + "integrity": "sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==" + }, "react-proxy": { "version": "1.1.8", "resolved": "https://registry.npmjs.org/react-proxy/-/react-proxy-1.1.8.tgz", @@ -11268,6 +11278,14 @@ "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", "dev": true }, + "shortid": { + "version": "2.2.14", + "resolved": "https://registry.npmjs.org/shortid/-/shortid-2.2.14.tgz", + "integrity": "sha1-gNtqr8vD46RoULPIjTngUbhMjRg=", + "requires": { + "nanoid": "^2.0.0" + } + }, "signal-exit": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", diff --git a/package.json b/package.json index a44c246b4e..8a58da5be7 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,9 @@ "lodash.pick": "^4.4.0", "lodash.topath": "^4.5.2", "prop-types": "^15.5.8", - "react-is": "^16.8.4" + "react-is": "^16.8.4", + "react-lifecycles-compat": "^3.0.4", + "shortid": "^2.2.14" }, "devDependencies": { "@babel/cli": "^7.4.4", diff --git a/playground/samples/customArray.js b/playground/samples/customArray.js index 0e6934cae1..4e907b5485 100644 --- a/playground/samples/customArray.js +++ b/playground/samples/customArray.js @@ -5,7 +5,7 @@ function ArrayFieldTemplate(props) {