react.js:3640 Warning: Each child in an array or iterator should have a unique "key" prop. Check the render method of `UserList`. See https://fb.me/react-warning-keys for more information. in h3 (crea

react.js:3640 Warning: Each child in an array or iterator should have a unique "key" prop. Check the render method of UserList. See https://fb.me/react-warning-keys for more information.
in h3 (created by UserList)
in UserList

加上 key , 如下:

render: function () {
            var createItem = function (u) {
                return (

{u.username + ':' + JSON.stringify(u.roles)}

); } return (
    {this.state.users.map(createItem)}
); }

你可能感兴趣的:(react.js:3640 Warning: Each child in an array or iterator should have a unique "key" prop. Check the render method of `UserList`. See https://fb.me/react-warning-keys for more information. in h3 (crea)