Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[flow-strict] Flow strict StaticContainer #22121

Closed
wants to merge 13 commits into from
17 changes: 14 additions & 3 deletions Libraries/Components/StaticContainer.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*
* @format
* @flow
* @flow strict-local
*/

'use strict';
Expand All @@ -27,8 +27,19 @@ const React = require('React');
* Typically, you will not need to use this component and should opt for normal
* React reconciliation.
*/
class StaticContainer extends React.Component<Object> {
shouldComponentUpdate(nextProps: Object): boolean {

type Props = $ReadOnly<{|
/**
* Whether or not this component should update.
*/
shouldUpdate: ?boolean,
/**
* Content short-circuited by React reconciliation process.
*/
children: React.Node,
|}>;
class StaticContainer extends React.Component<Props> {
shouldComponentUpdate(nextProps: Props): boolean {
return !!nextProps.shouldUpdate;
}

Expand Down