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

Improve error message when mutable sources are mutated during render #20665

Merged

Commits on Jan 29, 2021

  1. Improve React error message when mutable sources are mutated during r…

    …ender
    
    Changed previous error message from:
    > Cannot read from mutable source during the current render without tearing. This is a bug in React. Please file an issue.
    
    To:
    > Cannot read from mutable source during the current render without tearing. This may be a bug in React. Please file an issue.
    
    Also added a DEV only warning about the unsafe side effect:
    > A mutable source was mutated while the %s component was rendering. This is not supported. Move any mutations into event handlers or effects.
    
    I think this is the best we can do without adding production overhead that we'd probably prefer to avoid.
    Brian Vaughn committed Jan 29, 2021
    Configuration menu
    Copy the full SHA
    eb42de7 View commit details
    Browse the repository at this point in the history