Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[0.63.1] Don't fire the render phase update warning for class lifecycles #29448

Closed
Ztarbox opened this issue Jul 21, 2020 · 7 comments
Closed
Labels
Needs: Attention Issues where the author has responded to feedback. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@Ztarbox
Copy link

Ztarbox commented Jul 21, 2020

Please provide all the information requested. Issues that do not follow this format are likely to stall.

Description

Like in react V16.13.0 the warning Cannot update a component from inside a body of a function component. is thrown from inside of class lifecycles too (i.e. redux-forms will trigger this warning on every synchronous validate).

While arguably these are real issues (they happen in render phase) it's pretty noisy for legacy code.
facebook/react#18330

The problem is part of the renderer ReactNativeRenderer-dev.js, and it seemed to me, that these types are auto-generated by a "sync tool"? So probably it just needed to be updated?

React Native version:

System:
OS: Windows 10 10.0.19042
CPU: (8) x64 Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz
Memory: 7.71 GB / 31.96 GB
Binaries:
Node: 12.18.2 - ~\AppData\Local\Temp\yarn--1595339538342-0.5834644449552555\node.CMD
Yarn: 1.22.4 - ~\AppData\Local\Temp\yarn--1595339538342-0.5834644449552555\yarn.CMD
npm: 6.9.0 - C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK:
API Levels: 28, 29
Build Tools: 28.0.3, 29.0.2, 30.0.0
System Images: android-28 | Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom_64, android-28 | Google Play Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: Version 3.6.0.0 AI-192.7142.36.36.6392135
Languages:
Java: 1.8.0_211 - C:\Program Files\Java\jdk1.8.0_211\bin\javac.EXE
Python: 2.7.18 - C:\Python27\python.EXE
npmPackages:
@react-native-community/cli: Not Found
react: 16.13.1 => 16.13.1
react-native: 0.63.1 => 0.63.1
npmGlobalPackages:
react-native: Not Found

yarn list
[...]
├─ @react-native-community/cli@4.10.1
└─ react-native@0.63.1

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

Its the same issue reported here for React v16.13.0 but for React-Native v0.63.1
redux-form/redux-form#4619

Expected Results

While arguably these are real issues (they happen in render phase) it's pretty noisy for legacy code.

@cristianoccazinsp
Copy link
Contributor

react-navigation is also triggering this warning pretty much after every screen change.

@Ztarbox
Copy link
Author

Ztarbox commented Jul 21, 2020

@cristianoccazinsp I had this too, after upgrading. Was triggered by calling navigator.setOptions inside render instead of (as shown in the docu) inside useLayoutEffect.
Probably it's something similar in your case?

@cristianoccazinsp
Copy link
Contributor

I'm not using navigator.setOptions at all (at least not anywhere in the code). From debugging, the culprit is most likely the compatibility layer and the withNavigation HOC.

Still not sure if this is a RN or react-navigation issue.

I've reported the issue here: react-navigation/react-navigation#8584

@chrisglein
Copy link

Looks like there's some vigorous back and forth on the react-navigation issue. When that investigation is wrapped up if it's pointing to a core RN issue we can return here. But in the meantime let's not double up.

@Ztarbox does the discussion on the react-navigation issue match your experience or is yours separate.

@Ztarbox
Copy link
Author

Ztarbox commented Jul 22, 2020

I believe it could be a similar issue, in terms of 'a warning is shown that should not, because of legacy code' but it is a different warning message and it is triggered by react-navigation.

I'm talking about a warning which occurrence already was reduced in react itself for class components (see above linked PR) and in my case is triggered by a ClassComponents of redux-form.

So I am sure, that the warning I am talking about could be hidden based on the same reasoning it was done in react. But I am not sure for the react-navigation warning.

@github-actions github-actions bot added Needs: Attention Issues where the author has responded to feedback. and removed Needs: Author Feedback labels Jul 22, 2020
@github-actions
Copy link

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Jun 13, 2023
@github-actions
Copy link

This issue was closed because it has been stalled for 7 days with no activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Attention Issues where the author has responded to feedback. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

3 participants