Skip to content

Commit c0b8ce4

Browse files
authored
chore: Replace deprecated "componentWillMount" with "componentDidMount" (#7259)
1 parent bfe0d2b commit c0b8ce4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/react-router-native/experimental/StackRoute.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class StackContainer extends Component {
3535
};
3636
}
3737

38-
componentWillMount() {
38+
componentDidMount() {
3939
this.pushToStack("down");
4040
}
4141

@@ -435,7 +435,7 @@ class StackRootContainer extends Component {
435435
}
436436

437437
class RedirectStack extends Component {
438-
componentWillMount() {
438+
componentDidMount() {
439439
delete rootStoredLocations[this.props.path];
440440
}
441441

packages/react-router/modules/__tests__/Route-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ describe("A <Route>", () => {
238238
const history = createHistory();
239239
const mount = jest.fn();
240240
class MatchedRoute extends React.Component {
241-
componentWillMount() {
241+
componentDidMount() {
242242
mount();
243243
}
244244

0 commit comments

Comments
 (0)