Skip to content

Commit

Permalink
refactor: remove unnecessary judgment when check fragment props
Browse files Browse the repository at this point in the history
  • Loading branch information
gebilaoxiong committed Sep 5, 2018
1 parent 9a110eb commit 7aef631
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/react/src/ReactElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ function defineKeyPropWarningGetter(props, displayName) {
Object.defineProperty(props, 'key', {
get: warnAboutAccessingKey,
configurable: true,
enumerable: false,
});
}

Expand All @@ -85,6 +86,7 @@ function defineRefPropWarningGetter(props, displayName) {
Object.defineProperty(props, 'ref', {
get: warnAboutAccessingRef,
configurable: true,
enumerable: false,
});
}

Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/ReactElementValidator.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ function validateFragmentProps(fragment) {
const keys = Object.keys(fragment.props);
for (let i = 0; i < keys.length; i++) {
const key = keys[i];
if (key !== 'children' && key !== 'key') {
if (key !== 'children') {
warning(
false,
'Invalid prop `%s` supplied to `React.Fragment`. ' +
Expand Down

0 comments on commit 7aef631

Please sign in to comment.