Skip to content

Commit 8aa8a29

Browse files
committed
updated lifecycle methods
1 parent afcaea4 commit 8aa8a29

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

lib/components/Provider.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ export default class Provider extends React.Component<PropsType> {
4646
}
4747
}
4848

49-
componentWillReceiveProps(nextProps: PropsType) {
49+
componentDidUpdate(prevProps: PropsType) {
5050
if (
51-
this.props.language !== nextProps.language ||
52-
this.props.translation !== nextProps.translation
51+
prevProps.language !== this.props.language ||
52+
prevProps.translation !== this.props.translation
5353
) {
5454
this.notify()
5555
}

lib/components/createSubscribe.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const createSubscribe: createSubscribeType = ({ Component }) =>
1919

2020
unsubscribe: () => void
2121

22-
componentWillMount() {
22+
componentDidMount() {
2323
this.unsubscribe = this.context.translated.subscribe(() =>
2424
this.forceUpdate(),
2525
)

0 commit comments

Comments
 (0)