Skip to content

Strange optimization only in production mode #5005

@AlexGalays

Description

@AlexGalays

The 0.14-rc1 version brings a few performance optimisations that unfortunately behave differently when React is compiled in development or production mode.

This is very confusing as code that works in one mode should still work in the other.

Development mode Fiddle
Logs

render Hello
render World
render Hello
render World

(That's the React 0.13.x behavior)

Production mode Fiddle
Logs only

render Hello
render World
render Hello

The "optimization" seems to trigger when a component reference didn't change.
This fiddle uses the production build but the child component is always a new instance and it works as expected :

Production mode with workaround

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions