This repository has been archived by the owner on Mar 30, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
componentWillReceiveProps shows deprication warning in React v16.9 #19
Comments
+1 Also:
|
Looks like they've abandoned this repo. Why pay for a service that doesn't bother with updates? |
I have made a pull request for this. Please check #22 this PR. |
Those logs are annoying. @ryanashcraft Would you mind taking a look at this? :) |
My personal solution for this kind of things:
// @ts-ignore
// eslint-disable-next-line no-console
const originalError = console.error;
// eslint-disable-next-line no-console
console.error = (...args): void => {
if (/Warning.*Function components cannot be given refs/.test(args[0])) {
// HACK: Muting error, fix as soon as https://github.com/zeit/next.js/issues/7915 gets resolved
return;
}
originalError.call(console, ...args);
};
// eslint-disable-next-line no-console
console.warn = (...args): void => {
if (/Warning.*componentWillMount has been renamed, and is not recommended for use/.test(args[0])) {
// HACK: Muting warning, fix as soon as https://github.com/amplitude/react-amplitude/issues/19 gets resolved
return;
} else if (/Warning.*componentWillReceiveProps has been renamed, and is not recommended for use/.test(args[0])) {
// HACK: Muting warning, fix as soon as https://github.com/amplitude/react-amplitude/issues/19 gets resolved
return;
} else if (/Warning.*componentWillMount has been renamed, and is not recommended for use/.test(args[0])) {
// HACK: Muting warning, fix as soon as https://github.com/amplitude/react-amplitude/issues/19 gets resolved
return;
}
originalError.call(console, ...args);
};
Import that file in your main loader ( |
Are there any updates to this? |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Need to remove
componentWillReceiveProps
inreact-amplitude/blob/master/src/components/Amplitude.js
as this is being removed in React v17The text was updated successfully, but these errors were encountered: