Skip to content

Commit 995cb07

Browse files
Claudio Procidafacebook-github-bot
Claudio Procida
authored andcommitted
Fixes warning for missing keys in example color controls (#1853)
Summary: **Summary** Fixes a warning in the color examples for missing keys for elements in an array for the style controls. ``` react.development.js:336 Warning: Each child in an array or iterator should have a unique "key" prop. Check the render method of `ColorControls`. See https://fb.me/react-warning-keys for more information. in StyleButton (created by ColorControls) in ColorControls (created by ColorfulEditorExample) in div (created by ColorfulEditorExample) in ColorfulEditorExample ``` **Test Plan** Manual tests on Chrome, warnings are gone **Note:** This PR also fixes the [Travis CI build failure](https://travis-ci.org/facebook/draft-js/jobs/424170309) introduced with e6c693c Pull Request resolved: facebookarchive/draft-js#1853 Differential Revision: D9654616 fbshipit-source-id: 1e4e9a4ef2eb896306404acc31623076e107b91c
1 parent 4e972a6 commit 995cb07

File tree

4 files changed

+4
-2
lines changed

4 files changed

+4
-2
lines changed

examples/draft-0-10-0/color/color.html

+1
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@
146146
<div style={styles.controls}>
147147
{COLORS.map(type =>
148148
<StyleButton
149+
key={type.label}
149150
active={currentStyle.has(type.style)}
150151
label={type.label}
151152
onToggle={props.onToggle}

examples/draft-0-9-1/color/color.html

+1
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@
146146
<div style={styles.controls}>
147147
{COLORS.map(type =>
148148
<StyleButton
149+
key={type.label}
149150
active={currentStyle.has(type.style)}
150151
label={type.label}
151152
onToggle={props.onToggle}

meta/bundle-size-stats/Draft.js.json

+1-1
Large diffs are not rendered by default.

meta/bundle-size-stats/Draft.min.js.json

+1-1
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)