question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Console warning when adding reactn to class

See original GitHub issue

Hello, I notice some warnings when adding reactn to a class:

`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: ##ComponentName##`

How to reproduce:

Create a new project with create-react-app Create a component `import React, { Component } from ‘react’

export default class Compo extends Component { render() { return ( <div> I am a Component </div> ) } } ` and include it in App.js

Run -> No warnings change first line to `import React, { Component } from ‘reactn’ get warning:

`react-dom.development.js:12449 Warning: componentWillUpdate has been renamed, and is not recommended for use. See https://fb.me/react-unsafe-component-lifecycles 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: Compo`

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:20 (14 by maintainers)

github_iconTop GitHub Comments

3reactions
siapdevcommented, Jan 9, 2020

Hi @CharlesStover, I have attempted the pseudocode you mentioned and it works! Made a PR that satisfies all tests, hope that helps! Umberto Ghio

1reaction
umbertoghiocommented, Jan 30, 2020

@jasonbodily hi, seems that the current release on npm does not include yet this fix.

You may temporarily clone from this master or temporarily use version “SIAPCN/reactnUnsafe” in your package.json instead of 2.2.5, it contains the workaround that suppressed the warnings

Read more comments on GitHub >

github_iconTop Results From Across the Web

Passing an object to console.warn causing error in react-native
console.warn messages in React Native are shown in the native app with YellowBox. YellowBox can only display strings, not objects.
Read more >
Remove warnings when rendering react-native components
Even with shallow() I have one warning: console.error node_modules/react-native/Libraries/Core/ExceptionsManager.js:71 Warning: ReactTestUtils has been moved to ...
Read more >
How to Upgrade to React 18
When you first install React 18, you will see a warning in the console: ReactDOM.render is no longer supported in React 18.
Read more >
Node.js Logging Tutorial - Stackify
Log levels “error” and “warn” will go to stderr when called from the console. We want to log exceptions so we know when...
Read more >
Logging and Trace - Haxe - The Cross-platform Toolkit
In most Haxe targets trace will be printed to stdout. JavaScript uses console.log . Each trace is displayed with the filename and line...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found