Skip to content

Commit 36ea1de

Browse files
excedfacebook-github-bot
authored andcommitted
Flow strict StaticContainer (facebook#22121)
Summary: Related to facebook#22100 Turn on Flow strict mode for StaticContainer.react This component needed proper Props type definition. I went through the only component (`TabBarItemIOS.ios`) using this to try to know the most appropriate props. - All flow tests succeed. [GENERAL] [ENHANCEMENT] [StaticContainer.react.js] - Flow strict mode Pull Request resolved: facebook#22121 Differential Revision: D12929646 Pulled By: TheSavior fbshipit-source-id: 8826aa7bc83c854efdd71cdb4fba3d7ca98f2fce
1 parent f4a3b8f commit 36ea1de

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

Libraries/Components/StaticContainer.react.js

+14-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* LICENSE file in the root directory of this source tree.
66
*
77
* @format
8-
* @flow
8+
* @flow strict-local
99
*/
1010

1111
'use strict';
@@ -27,8 +27,19 @@ const React = require('React');
2727
* Typically, you will not need to use this component and should opt for normal
2828
* React reconciliation.
2929
*/
30-
class StaticContainer extends React.Component<Object> {
31-
shouldComponentUpdate(nextProps: Object): boolean {
30+
31+
type Props = $ReadOnly<{|
32+
/**
33+
* Whether or not this component should update.
34+
*/
35+
shouldUpdate: ?boolean,
36+
/**
37+
* Content short-circuited by React reconciliation process.
38+
*/
39+
children: React.Node,
40+
|}>;
41+
class StaticContainer extends React.Component<Props> {
42+
shouldComponentUpdate(nextProps: Props): boolean {
3243
return !!nextProps.shouldUpdate;
3344
}
3445

0 commit comments

Comments
 (0)