React: unexpected re-render between different node_env

Created on 8 Aug 2017  路  5Comments  路  Source: facebook/react

Hi 馃檪

Do you want to request a feature or report a bug?
I'm reporting a bug that gets me crazy!

What is the current behavior?
We found a very strange behavior between the development version and the production one.
We don't know why but with the production build when a redirect happens the entire tree under the switch component is re-rendered from scratch.

NODE_ENV = development

dev

NODE_ENV = production

prod

We noticed that in the production env keys are generated every time the route changes.
I opened an issue on react-router repos also.
We tried also to don't minify anything and the result it is the same.

Someone knows why this is happening and what may be causing it?

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
react: 15.5.4
react-router-dom: 4.1.1
OS: MacOS Sierra Version 10.12.4
Browser: Google Chrome Version 60.0.3112.78 (Official Build) (64-bit)

Needs More Information

Most helpful comment

Could you please provide a full example?
This is not enough information to help you.

All 5 comments

Could you please provide a full example?
This is not enough information to help you.

Hi @gaearon,
Thanks for your support 馃憤

I created a repo here with the same structure of our project (I can't pass the entire project).
But I can't reproduce the issue in this project 馃檨 .

Could be something on our project... but what?

We think that could be the Loader component that mounting every time when we fetch the user on redirect, but why we don't have the same behavior on dev?

SInce there's been no update on this, and there's no reproduction that we can investigate, I'm going to close this out. If you can isolate the issue further and provide a clear reproduction that demonstrates an issue with React, I'll be happy to help and re-open!

If you need general help figuring out how to isolate or resolve this issue I suggest checking out the resources listed in Where to Get Support.

@CVarisco I have the same problem . Did you figure out what was the problem ?

@bhoomipatel6386 Updating version of React should solve the issue.
If not, probably was related on our env.

Sorry man 馃檨

Was this page helpful?
0 / 5 - 0 ratings