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

useRef: Warn about reading or writing mutable values during render #18545

Merged
merged 2 commits into from
Oct 19, 2020

Commits on Oct 19, 2020

  1. useRef: Warn about reading or writing mutable values during render

    Reading or writing a ref value during render is only safe if you are implementing the lazy initialization pattern.
    
    Other types of reading are unsafe as the ref is a mutable source.
    
    Other types of writing are unsafe as they are effectively side effects.
    Brian Vaughn committed Oct 19, 2020
    Configuration menu
    Copy the full SHA
    32e5c1b View commit details
    Browse the repository at this point in the history
  2. PR feedback

    • Changed tests to use pragma
    • Renamed feature flag
    Brian Vaughn committed Oct 19, 2020
    Configuration menu
    Copy the full SHA
    551985a View commit details
    Browse the repository at this point in the history