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

Remove defaultProps from DatePickeriOS | #31605 #31608

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions Libraries/Components/DatePicker/DatePickerIOS.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,6 @@ type Props = $ReadOnly<{|
* source of truth.
*/
class DatePickerIOS extends React.Component<Props> {
static DefaultProps: {|mode: $TEMPORARY$string<'datetime'>|} = {
mode: 'datetime',
};

_picker: ?React.ElementRef<typeof RCTDatePickerNativeComponent> = null;

componentDidUpdate() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ type NativeProps = $ReadOnly<{|
* );
* ```
*/
drawerBackgroundColor: ColorValue,

/**
* Specifies the side of the screen from which the drawer will slide in.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ type Props = $ReadOnly<{|
* );
* ```
*/
drawerBackgroundColor: ColorValue,

/**
* Specifies the side of the screen from which the drawer will slide in.
Expand Down Expand Up @@ -161,11 +160,6 @@ class DrawerLayoutAndroid extends React.Component<Props, State> {

return {Left: 'left', Right: 'right'};
}
static defaultProps: {|
drawerBackgroundColor: 'white',
|} = {
drawerBackgroundColor: 'white',
};

_nativeRef = React.createRef<
React.ElementRef<typeof AndroidDrawerLayoutNativeComponent>,
Expand All @@ -189,7 +183,6 @@ class DrawerLayoutAndroid extends React.Component<Props, State> {
styles.drawerSubview,
{
width: this.props.drawerWidth,
backgroundColor: this.props.drawerBackgroundColor,
},
]}
collapsable={false}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

exports[`<DrawerLayoutAndroid /> should render as expected: should deep render when mocked (please verify output manually) 1`] = `
<AndroidDrawerLayout
drawerBackgroundColor="white"
drawerPosition="left"
drawerWidth={300}
onDrawerClose={[Function]}
Expand Down Expand Up @@ -41,7 +40,6 @@ exports[`<DrawerLayoutAndroid /> should render as expected: should deep render w
"top": 0,
},
Object {
"backgroundColor": "white",
"width": 300,
},
]
Expand All @@ -54,7 +52,6 @@ exports[`<DrawerLayoutAndroid /> should render as expected: should deep render w

exports[`<DrawerLayoutAndroid /> should render as expected: should deep render when not mocked (please verify output manually) 1`] = `
<AndroidDrawerLayout
drawerBackgroundColor="white"
drawerPosition="left"
drawerWidth={300}
onDrawerClose={[Function]}
Expand Down Expand Up @@ -93,7 +90,6 @@ exports[`<DrawerLayoutAndroid /> should render as expected: should deep render w
"top": 0,
},
Object {
"backgroundColor": "white",
"width": 300,
},
]
Expand All @@ -106,7 +102,6 @@ exports[`<DrawerLayoutAndroid /> should render as expected: should deep render w

exports[`<DrawerLayoutAndroid /> should render as expected: should shallow render as <DrawerLayoutAndroid /> when mocked 1`] = `
<DrawerLayoutAndroid
drawerBackgroundColor="white"
drawerPosition="left"
drawerWidth={300}
renderNavigationView={[Function]}
Expand All @@ -115,7 +110,6 @@ exports[`<DrawerLayoutAndroid /> should render as expected: should shallow rende

exports[`<DrawerLayoutAndroid /> should render as expected: should shallow render as <DrawerLayoutAndroid /> when not mocked 1`] = `
<DrawerLayoutAndroid
drawerBackgroundColor="white"
drawerPosition="left"
drawerWidth={300}
renderNavigationView={[Function]}
Expand Down
4 changes: 0 additions & 4 deletions Libraries/Components/Picker/Picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,6 @@ class Picker extends React.Component<PickerProps> {

static Item: typeof PickerItem = PickerItem;

static defaultProps: {|mode: $TEMPORARY$string<'dialog'>|} = {
mode: MODE_DIALOG,
};

render(): React.Node {
if (Platform.OS === 'ios') {
/* $FlowFixMe[prop-missing] (>=0.81.0 site=react_native_ios_fb) This
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ exports[`<Picker /> should render as expected: should deep render when not mocke

exports[`<Picker /> should render as expected: should shallow render as <Picker /> when mocked 1`] = `
<Picker
mode="dialog"
onValueChange={[MockFunction]}
selectedValue="foo"
>
Expand All @@ -81,7 +80,6 @@ exports[`<Picker /> should render as expected: should shallow render as <Picker

exports[`<Picker /> should render as expected: should shallow render as <Picker /> when not mocked 1`] = `
<Picker
mode="dialog"
onValueChange={[MockFunction]}
selectedValue="foo"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,6 @@ type Props = $ReadOnly<{|
*/

class SegmentedControlIOS extends React.Component<Props> {
static defaultProps = {
values: [],
enabled: true,
};

_onChange = (event: SyntheticEvent<OnChangeEvent>) => {
this.props.onChange && this.props.onChange(event);
this.props.onValueChange &&
Expand Down
8 changes: 0 additions & 8 deletions Libraries/Components/StatusBar/StatusBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,14 +384,6 @@ class StatusBar extends React.Component<Props> {
return newEntry;
}

static defaultProps: {|
animated: boolean,
showHideTransition: $TEMPORARY$string<'fade'>,
|} = {
animated: false,
showHideTransition: 'fade',
};

_stackEntry = null;

componentDidMount() {
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Lists/FlatList.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ const defaultProps = {
* The alternative is that scrolling on Android is unusably bad. Enabling it on iOS has a few
* known issues.
*/
removeClippedSubviews: Platform.OS === 'android',
// removeClippedSubviews: Platform.OS === 'android',
};
export type DefaultProps = typeof defaultProps;

Expand Down
7 changes: 0 additions & 7 deletions Libraries/Lists/__tests__/__snapshots__/FlatList-test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ exports[`FlatList renders all the bells and whistles 1`] = `
/>
}
refreshing={false}
removeClippedSubviews={false}
renderItem={[Function]}
scrollEventThrottle={50}
stickyHeaderIndices={Array []}
Expand Down Expand Up @@ -132,7 +131,6 @@ exports[`FlatList renders empty list 1`] = `
onScroll={[Function]}
onScrollBeginDrag={[Function]}
onScrollEndDrag={[Function]}
removeClippedSubviews={false}
renderItem={[Function]}
scrollEventThrottle={50}
stickyHeaderIndices={Array []}
Expand All @@ -154,7 +152,6 @@ exports[`FlatList renders null list 1`] = `
onScroll={[Function]}
onScrollBeginDrag={[Function]}
onScrollEndDrag={[Function]}
removeClippedSubviews={false}
renderItem={[Function]}
scrollEventThrottle={50}
stickyHeaderIndices={Array []}
Expand Down Expand Up @@ -189,7 +186,6 @@ exports[`FlatList renders simple list (multiple columns) 1`] = `
onScroll={[Function]}
onScrollBeginDrag={[Function]}
onScrollEndDrag={[Function]}
removeClippedSubviews={false}
renderItem={[Function]}
scrollEventThrottle={50}
stickyHeaderIndices={Array []}
Expand Down Expand Up @@ -260,7 +256,6 @@ exports[`FlatList renders simple list 1`] = `
onScroll={[Function]}
onScrollBeginDrag={[Function]}
onScrollEndDrag={[Function]}
removeClippedSubviews={false}
renderItem={[Function]}
scrollEventThrottle={50}
stickyHeaderIndices={Array []}
Expand Down Expand Up @@ -321,7 +316,6 @@ exports[`FlatList renders simple list using ListItemComponent (multiple columns)
onScroll={[Function]}
onScrollBeginDrag={[Function]}
onScrollEndDrag={[Function]}
removeClippedSubviews={false}
scrollEventThrottle={50}
stickyHeaderIndices={Array []}
viewabilityConfigCallbackPairs={Array []}
Expand Down Expand Up @@ -392,7 +386,6 @@ exports[`FlatList renders simple list using ListItemComponent 1`] = `
onScroll={[Function]}
onScrollBeginDrag={[Function]}
onScrollEndDrag={[Function]}
removeClippedSubviews={false}
scrollEventThrottle={50}
stickyHeaderIndices={Array []}
viewabilityConfigCallbackPairs={Array []}
Expand Down
4 changes: 2 additions & 2 deletions tools/build_defs/oss/rn_defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ def rn_robolectric_test(name, srcs, vm_args = None, *args, **kwargs):
"-XX:+UseConcMarkSweepGC", # required by -XX:+CMSClassUnloadingEnabled
"-XX:+CMSClassUnloadingEnabled",
"-XX:ReservedCodeCacheSize=150M",
"-Drobolectric.dependency.dir=buck-out/gen/ReactAndroid/src/main/third-party/java/robolectric/4.4",
"-Dlibraries=buck-out/gen/ReactAndroid/src/main/third-party/java/robolectric/4.4/*.jar",
"-Drobolectric.dependency.dir=buck-out/gen/ReactAndroid/src/main/third-party/java/robolectric",
"-Dlibraries=buck-out/gen/ReactAndroid/src/main/third-party/java/robolectric/*.jar",
"-Drobolectric.logging.enabled=true",
"-XX:MaxPermSize=620m",
"-Drobolectric.offline=true",
Expand Down