Skip to content

Commit

Permalink
fix: use unsafe prefix fixes #803
Browse files Browse the repository at this point in the history
  • Loading branch information
BANG88 committed Apr 3, 2020
1 parent a048a68 commit 8fe842d
Show file tree
Hide file tree
Showing 17 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion components/checkbox/Checkbox.tsx
Expand Up @@ -23,7 +23,7 @@ export default class Checkbox extends React.Component<CheckboxProps, any> {
};
}

componentWillReceiveProps(nextProps: CheckboxProps): void {
UNSAFE_componentWillReceiveProps(nextProps: CheckboxProps): void {
if (typeof nextProps.checked === 'boolean') {
this.setState({
checked: !!nextProps.checked,
Expand Down
2 changes: 1 addition & 1 deletion components/date-picker/datepicker/DatePicker.tsx
Expand Up @@ -52,7 +52,7 @@ class DatePicker extends React.Component<DatePickerProps, any> {
defaultMinDate: any;
defaultMaxDate: any;

componentWillReceiveProps(nextProps: { date: any; defaultDate: any }) {
UNSAFE_componentWillReceiveProps(nextProps: { date: any; defaultDate: any }) {
if ('date' in nextProps) {
this.setState({
date: nextProps.date || nextProps.defaultDate,
Expand Down
2 changes: 1 addition & 1 deletion components/drawer/index.tsx
Expand Up @@ -23,7 +23,7 @@ export default class Drawer extends React.Component<DrawerNativeProps, any> {
}
}

componentWillReceiveProps(nextProps: DrawerNativeProps) {
UNSAFE_componentWillReceiveProps(nextProps: DrawerNativeProps) {
if (nextProps.open !== this.props.open && this.drawer) {
this.drawer[nextProps.open ? 'openDrawer' : 'closeDrawer']();
}
Expand Down
2 changes: 1 addition & 1 deletion components/image-picker/CameraRollPicker.tsx
Expand Up @@ -70,7 +70,7 @@ class CameraRollPicker extends Component<
};
}

componentWillReceiveProps(nextProps: CameraRollPickerProps) {
UNSAFE_componentWillReceiveProps(nextProps: CameraRollPickerProps) {
this.setState({
selected: nextProps.selected,
});
Expand Down
2 changes: 1 addition & 1 deletion components/image-picker/ImageItem.tsx
Expand Up @@ -19,7 +19,7 @@ class ImageItem extends Component<ImageItemProps, {}> {
constructor(props: ImageItemProps) {
super(props);
}
componentWillMount() {
UNSAFE_componentWillMount() {
let { width } = Dimensions.get('window');
const { imageMargin, imagesPerRow, containerWidth } = this.props;
if (typeof containerWidth !== 'undefined') {
Expand Down
2 changes: 1 addition & 1 deletion components/input-item/Input.tsx
Expand Up @@ -17,7 +17,7 @@ class Input extends React.Component<TextInputProps, any> {
};
}

componentWillReceiveProps(nextProps: TextInputProps) {
UNSAFE_componentWillReceiveProps(nextProps: TextInputProps) {
if (nextProps.focused !== this.state.focused) {
this.setState({
focused: nextProps.focused,
Expand Down
2 changes: 1 addition & 1 deletion components/modal/ModalView.tsx
Expand Up @@ -72,7 +72,7 @@ export default class RCModal extends React.Component<IModalPropTypes, any> {
modalVisible: visible,
};
}
componentWillReceiveProps(nextProps: IModalPropTypes) {
UNSAFE_componentWillReceiveProps(nextProps: IModalPropTypes) {
if (this.shouldComponentUpdate(nextProps, null)) {
this.setState({
modalVisible: true,
Expand Down
2 changes: 1 addition & 1 deletion components/pagination/index.tsx
Expand Up @@ -44,7 +44,7 @@ export default class Pagination extends React.Component<
};
}

componentWillReceiveProps(nextProps: PaginationNativeProps) {
UNSAFE_componentWillReceiveProps(nextProps: PaginationNativeProps) {
if (nextProps.current !== this.state.current) {
this.setState({
current: nextProps.current,
Expand Down
2 changes: 1 addition & 1 deletion components/picker/PopupMixin.tsx
Expand Up @@ -45,7 +45,7 @@ export default function PopupMixin(
};
}

componentWillReceiveProps(nextProps: { value: any; visible: any }) {
UNSAFE_componentWillReceiveProps(nextProps: { value: any; visible: any }) {
if ('value' in nextProps) {
this.setState({
pickerValue: nextProps.value,
Expand Down
2 changes: 1 addition & 1 deletion components/picker/cascader/Cascader.tsx
Expand Up @@ -18,7 +18,7 @@ class Cascader extends React.Component<CascaderProps, any> {
),
};

componentWillReceiveProps(nextProps: { data: any; value: any }) {
UNSAFE_componentWillReceiveProps(nextProps: { data: any; value: any }) {
if ('value' in nextProps) {
this.setState({
value: this.getValue(nextProps.data, nextProps.value),
Expand Down
2 changes: 1 addition & 1 deletion components/progress/index.tsx
Expand Up @@ -29,7 +29,7 @@ export default class Progress extends React.Component<ProgressProps, any> {
};
}

componentWillReceiveProps(nextProps: ProgressProps) {
UNSAFE_componentWillReceiveProps(nextProps: ProgressProps) {
if (nextProps.wrapWidth !== this.props.wrapWidth) {
this.setState({ wrapWidth: nextProps.wrapWidth });
}
Expand Down
2 changes: 1 addition & 1 deletion components/radio/Radio.tsx
Expand Up @@ -23,7 +23,7 @@ export default class Radio extends React.Component<RadioNativeProps, any> {
};
}

componentWillReceiveProps(nextProps: RadioNativeProps): void {
UNSAFE_componentWillReceiveProps(nextProps: RadioNativeProps): void {
if ('checked' in nextProps) {
this.setState({
checked: !!nextProps.checked,
Expand Down
2 changes: 1 addition & 1 deletion components/search-bar/index.tsx
Expand Up @@ -45,7 +45,7 @@ export default class SearchBar extends React.Component<
};
}

componentWillReceiveProps(nextProps: SearchBarProps) {
UNSAFE_componentWillReceiveProps(nextProps: SearchBarProps) {
if ('value' in nextProps) {
this.setState({
value: nextProps.value,
Expand Down
2 changes: 1 addition & 1 deletion components/segmented-control/segmented.android.tsx
Expand Up @@ -57,7 +57,7 @@ export default class SegmentedControl extends React.Component<
};
}

componentWillReceiveProps(nextProps: SegmentControlProps) {
UNSAFE_componentWillReceiveProps(nextProps: SegmentControlProps) {
if (nextProps.selectedIndex !== this.props.selectedIndex) {
this.setState({
selectedIndex: nextProps.selectedIndex,
Expand Down
2 changes: 1 addition & 1 deletion components/stepper/InputNumber.tsx
Expand Up @@ -89,7 +89,7 @@ export default class InputNumber<
} as S;
}

componentWillReceiveProps(nextProps: P) {
UNSAFE_componentWillReceiveProps(nextProps: P) {
if ('value' in nextProps) {
const value = this.state.focused
? nextProps.value
Expand Down
2 changes: 1 addition & 1 deletion components/tabs/Tabs.tsx
Expand Up @@ -288,7 +288,7 @@ export class Tabs extends React.PureComponent<TabsProps, StateType> {
);
};

componentWillReceiveProps(nextProps: PropsType) {
UNSAFE_componentWillReceiveProps(nextProps: PropsType) {
if (this.props.page !== nextProps.page && nextProps.page !== undefined) {
this.goToTab(this.getTabIndex(nextProps), true);
}
Expand Down
2 changes: 1 addition & 1 deletion components/tag/index.tsx
Expand Up @@ -34,7 +34,7 @@ export default class Tag extends React.Component<TagNativeProps, any> {
};
}

componentWillReceiveProps(nextProps: TagNativeProps) {
UNSAFE_componentWillReceiveProps(nextProps: TagNativeProps) {
if (this.props.selected !== nextProps.selected) {
this.setState({
selected: nextProps.selected,
Expand Down

0 comments on commit 8fe842d

Please sign in to comment.