Browse Source

Update StrictMode docs about double logging (#4531)

main
dan 3 years ago
committed by GitHub
parent
commit
0982707a98
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      content/docs/strict-mode.md

4
content/docs/strict-mode.md

@ -119,7 +119,9 @@ By intentionally double-invoking methods like the component constructor, strict
> Note:
>
> Starting with React 17, React automatically modifies the console methods like `console.log()` to silence the logs in the second call to lifecycle functions. However, it may cause undesired behavior in certain cases where [a workaround can be used](https://github.com/facebook/react/issues/20090#issuecomment-715927125).
> In React 17, React automatically modifies the console methods like `console.log()` to silence the logs in the second call to lifecycle functions. However, it may cause undesired behavior in certain cases where [a workaround can be used](https://github.com/facebook/react/issues/20090#issuecomment-715927125).
>
> Starting from React 18, React does not suppress any logs. However, if you have React DevTools installed, the logs from the second call will appear slightly dimmed. React DevTools also offers a setting (off by default) to suppress them completely.
### Detecting legacy context API {#detecting-legacy-context-api}

Loading…
Cancel
Save