Skip to content

Commit 6f007e8

Browse files
Brian Vaughnfacebook-github-bot
authored andcommitted
Ran rename-unsafe-lifecycles codemod on xplat/js
Reviewed By: trueadm Differential Revision: D6889214 fbshipit-source-id: e815cda4b09f3650ae3b0b9a44ae6f5fcb48fe25
1 parent fa334ce commit 6f007e8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+75
-66
lines changed

IntegrationTests/ReactContentSizeUpdateTest.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ var ReactContentSizeUpdateTest = createReactClass({
3030
mixins: [Subscribable.Mixin,
3131
TimerMixin],
3232

33-
componentWillMount: function() {
33+
UNSAFE_componentWillMount: function() {
3434
this.addListenerOn(
3535
RCTNativeAppEventEmitter,
3636
'rootViewDidChangeIntrinsicSize',

IntegrationTests/SizeFlexibilityUpdateTest.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ var SizeFlexibilityUpdateTest = createReactClass({
2727
displayName: 'SizeFlexibilityUpdateTest',
2828
mixins: [Subscribable.Mixin],
2929

30-
componentWillMount: function() {
30+
UNSAFE_componentWillMount: function() {
3131
this.addListenerOn(
3232
RCTNativeAppEventEmitter,
3333
'rootViewDidChangeIntrinsicSize',

Libraries/Animated/src/__tests__/Animated-test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@ describe('Animated tests', () => {
9494
opacity: anim,
9595
},
9696
};
97-
c.componentWillMount();
97+
c.UNSAFE_componentWillMount();
9898

9999
expect(anim.__detach).not.toBeCalled();
100100
c._component = {};
101-
c.componentWillReceiveProps({
101+
c.UNSAFE_componentWillReceiveProps({
102102
style: {
103103
opacity: anim,
104104
},
@@ -120,7 +120,7 @@ describe('Animated tests', () => {
120120
opacity: anim,
121121
},
122122
};
123-
c.componentWillMount();
123+
c.UNSAFE_componentWillMount();
124124

125125
Animated.timing(anim, {toValue: 10, duration: 1000}).start(callback);
126126
c._component = {};

Libraries/Animated/src/__tests__/AnimatedNative-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const NativeAnimatedHelper = require('NativeAnimatedHelper');
2929
function createAndMountComponent(ComponentClass, props) {
3030
const component = new ComponentClass();
3131
component.props = props;
32-
component.componentWillMount();
32+
component.UNSAFE_componentWillMount();
3333
// Simulate that refs were set.
3434
component._component = {};
3535
component.componentDidMount();

Libraries/Animated/src/createAnimatedComponent.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function createAnimatedComponent(Component: any): any {
4242
this._component.setNativeProps(props);
4343
}
4444

45-
componentWillMount() {
45+
UNSAFE_componentWillMount() {
4646
this._attachProps(this.props);
4747
}
4848

@@ -127,7 +127,7 @@ function createAnimatedComponent(Component: any): any {
127127
oldPropsAnimated && oldPropsAnimated.__detach();
128128
}
129129

130-
componentWillReceiveProps(newProps) {
130+
UNSAFE_componentWillReceiveProps(newProps) {
131131
this._attachProps(newProps);
132132
}
133133

Libraries/Components/Keyboard/KeyboardAvoidingView.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ const KeyboardAvoidingView = createReactClass({
133133
this.frame = event.nativeEvent.layout;
134134
},
135135

136-
componentWillUpdate(nextProps: Object, nextState: Object, nextContext?: Object): void {
136+
UNSAFE_componentWillUpdate(nextProps: Object, nextState: Object, nextContext?: Object): void {
137137
if (nextState.bottom === this.state.bottom &&
138138
this.props.behavior === 'height' &&
139139
nextProps.behavior === 'height') {
@@ -143,7 +143,7 @@ const KeyboardAvoidingView = createReactClass({
143143
}
144144
},
145145

146-
componentWillMount() {
146+
UNSAFE_componentWillMount() {
147147
if (Platform.OS === 'ios') {
148148
this.subscriptions = [
149149
Keyboard.addListener('keyboardWillChangeFrame', this._onKeyboardChange),

Libraries/Components/LazyRenderer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ var LazyRenderer = createReactClass({
2323
render: PropTypes.func.isRequired,
2424
},
2525

26-
componentWillMount: function(): void {
26+
UNSAFE_componentWillMount: function(): void {
2727
this.setState({
2828
_lazyRender : true,
2929
});

Libraries/Components/Navigation/NavigatorIOS.ios.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ var NavigatorIOS = createReactClass({
515515

516516
navigator: (undefined: ?Object),
517517

518-
componentWillMount: function() {
518+
UNSAFE_componentWillMount: function() {
519519
// Precompute a pack of callbacks that's frequently generated and passed to
520520
// instances.
521521
this.navigator = {

Libraries/Components/Picker/PickerAndroid.android.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class PickerAndroid extends React.Component<{
6666
};
6767
}
6868

69-
componentWillReceiveProps(nextProps) {
69+
UNSAFE_componentWillReceiveProps(nextProps) {
7070
this.setState(this._stateFromProps(nextProps));
7171
}
7272

Libraries/Components/Picker/PickerIOS.ios.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ var PickerIOS = createReactClass({
4141
return this._stateFromProps(this.props);
4242
},
4343

44-
componentWillReceiveProps: function(nextProps) {
44+
UNSAFE_componentWillReceiveProps: function(nextProps) {
4545
this.setState(this._stateFromProps(nextProps));
4646
},
4747

0 commit comments

Comments
 (0)