Jss: Deprecation warning of componentWillUpdate

Created on 27 Aug 2019  路  2Comments  路  Source: cssinjs/jss

Upgrading to React 16.9.0, I see warnings for all my components using JSS, for instance:

react-dom.development.js:11495 Warning: componentWillUpdate has been renamed, and is not recommended for use. See https://fb.me/react-async-component-lifecycle-hooks for details.

* Move data fetching code or side effects to componentDidUpdate.
* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.

Please update the following components: Jss(InformationPage)

I wonder if there will be a fix for these warnings before the release of v10? We are many developers on a project and are unsure whether to upgrade to v10 alpha now, to get rid of them, or there will be a release in-between to fix this?

Best,
Jan

enhancement

Most helpful comment

Since the warning only exists in development mode, I think I can handle it. I am just curious whether we will see a solution before moving to v10?

@kof, can you give an estimate for when v10 is out of alpha?

Best,
Jan

All 2 comments

We've worked around this by using:

const filterJssWarning = (message: string) => {
    if (
        message.includes('as been renamed, and is not recommended for use.') &&
        message.includes('Jss(')
    ) {
        return;
    }
    originalWarn(message);
};

// eslint-disable-next-line no-console
console.warn = filterJssWarning;

Not sure when/if a new JSS version is planned.

Since the warning only exists in development mode, I think I can handle it. I am just curious whether we will see a solution before moving to v10?

@kof, can you give an estimate for when v10 is out of alpha?

Best,
Jan

Was this page helpful?
0 / 5 - 0 ratings

Related issues

HenriBeck picture HenriBeck  路  4Comments

Telokis picture Telokis  路  3Comments

trusktr picture trusktr  路  6Comments

janhartmann picture janhartmann  路  5Comments

oliviertassinari picture oliviertassinari  路  6Comments