Cleanup StaticContainer a bit
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:
Родитель
bf32023e50
Коммит
b7bc31a305
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче