Summary:
React is way better than it used to be...

Changelog: [Internal]

Reviewed By: zackargyle, lunaleaps

Differential Revision: D19421772

fbshipit-source-id: db82b68a0c2f31e9ef7e1875fd9e4bf27ef6295a
This commit is contained in:
Spencer Ahrens 2020-02-04 13:51:50 -08:00 коммит произвёл Facebook Github Bot
Родитель bf32023e50
Коммит b7bc31a305
1 изменённых файлов: 3 добавлений и 6 удалений

Просмотреть файл

@ -32,7 +32,7 @@ type Props = $ReadOnly<{|
/**
* Whether or not this component should update.
*/
shouldUpdate: ?boolean,
shouldUpdate?: ?boolean,
/**
* Content short-circuited by React reconciliation process.
*/
@ -43,11 +43,8 @@ class StaticContainer extends React.Component<Props> {
return !!nextProps.shouldUpdate;
}
render(): null | React$Node {
const child = this.props.children;
return child === null || child === false
? null
: React.Children.only(child);
render(): React.Node {
return this.props.children;
}
}