✨ Warn for Bad useEffect Return Value
The cleanup function for the useEffect hook must always be returned synchronously, something that’s not possible to do when an async function is used. We now warn in such cases.
https://github.com/facebook/react/pull/14069
The cleanup function for the useEffect hook must always be returned synchronously, something that’s not possible to do when an async function is used. We now warn in such cases.
https://github.com/facebook/react/pull/14069
GitHub
Warn for bad useEffect return value by sophiebits · Pull Request #14069 · facebook/react
Mostly to catch this:
useEffect(async () => {
// ...
return cleanup;
});
Is this too restrictive? Not sure if you would want to do like
useEffect(() => ref.current.style.color = &...
useEffect(async () => {
// ...
return cleanup;
});
Is this too restrictive? Not sure if you would want to do like
useEffect(() => ref.current.style.color = &...
🌁 Fix Crash During Server Render in React 16.6
React can be loaded into many JavaScript runtimes. Thanks to Tiago Nunes (tnunes), it can now again be loaded into environments without setTimeout (e.g. ClearScript for .NET).
https://github.com/facebook/react/pull/14103
React can be loaded into many JavaScript runtimes. Thanks to Tiago Nunes (tnunes), it can now again be loaded into environments without setTimeout (e.g. ClearScript for .NET).
https://github.com/facebook/react/pull/14103
GitHub
Fix crash during server render in React 16.6.0 by tnunes · Pull Request #14103 · facebook/react
This fixes a bug introduced in React 16.6.0, which was not present in 16.5.2.
Runtimes without setTimeout and clearTimeout (e.g. ClearScript for .NET) are now crashing just by importing react-dom.
...
Runtimes without setTimeout and clearTimeout (e.g. ClearScript for .NET) are now crashing just by importing react-dom.
...
🛠 Support React.memo and Timed-out Suspense Trees in Dev Tools
The official React Developer Tools browser extension was updated to support some of the newly released React features.
https://github.com/facebook/react-devtools/pull/1207
The official React Developer Tools browser extension was updated to support some of the newly released React features.
https://github.com/facebook/react-devtools/pull/1207
GitHub
Support React.memo and timed-out Suspense trees by bvaughn · Pull Request #1207 · facebook/react-devtools
Support React.memo
Resolves #1193
Commit 4d85b12
Remove React.pure (since it was never released in a stable) and add support for React.memo. Preserve previous custom displayName semantics.
Code
f...
Resolves #1193
Commit 4d85b12
Remove React.pure (since it was never released in a stable) and add support for React.memo. Preserve previous custom displayName semantics.
Code
f...
🎉 React 16.6.1 Patch Release
The latest patch release brings multiple bug fixes related to the recently released Suspense features. We can also expect a new alpha release soon.
https://github.com/facebook/react/releases/tag/v16.6.1
The latest patch release brings multiple bug fixes related to the recently released Suspense features. We can also expect a new alpha release soon.
https://github.com/facebook/react/releases/tag/v16.6.1
GitHub
facebook/react
A declarative, efficient, and flexible JavaScript library for building user interfaces. - facebook/react
🎣 Update on the Hooks RFC Feedback
Over the past weeks, many questions about the Hooks proposal were raised. Sebastian now posted an extensive answer to all of the concerns.
https://github.com/reactjs/rfcs/pull/68#issuecomment-439314884
Over the past weeks, many questions about the Hooks proposal were raised. Sebastian now posted an extensive answer to all of the concerns.
https://github.com/reactjs/rfcs/pull/68#issuecomment-439314884
GitHub
RFC: React Hooks by sebmarkbage · Pull Request #68 · reactjs/rfcs
In this RFC, we propose introducing Hooks to React. See the RFC and the documentation for more details.
https://reactjs.org/docs/hooks-overview.html
View formatted RFC
(The talk video has now been ...
https://reactjs.org/docs/hooks-overview.html
View formatted RFC
(The talk video has now been ...
📍 RFC: Marker Hook for Server-side Data
Leops (l3ops) published a proposal to allow extraction of server-side data and subsequent client-side hydration along the component tree.
https://github.com/reactjs/rfcs/pull/85
Leops (l3ops) published a proposal to allow extraction of server-side data and subsequent client-side hydration along the component tree.
https://github.com/reactjs/rfcs/pull/85
GitHub
RFC: Marker hook for server-side data by leops · Pull Request #85 · reactjs/rfcs
View rendered
This RFC proposes a useSerializable hook to automate the extraction, and subsequent hydration of serializable server-side data.
This RFC proposes a useSerializable hook to automate the extraction, and subsequent hydration of serializable server-side data.
💅 CSS Shorthand Property Warning
React soon warns when overlapping styles (e.g. border and borderBottom) change to avoid a common issues that users of React DOM run into.
https://github.com/facebook/react/pull/14183
React soon warns when overlapping styles (e.g. border and borderBottom) change to avoid a common issues that users of React DOM run into.
https://github.com/facebook/react/pull/14183
GitHub
Simplify CSS shorthand property warning by sophiebits · Pull Request #14183 · facebook/react
I figured out a simpler way to do #14181. It does allocate some but I think that's OK. Time complexity might even be better since we avoid the nested loops the old one had.
⚠️ Remove Relay Classic Plugin from Dev Tools
Thanks to a contribution from Avi Johnson (avijohnson), the deprecated relay classic plugin will no longer be part of future Dev Tools build. This removes complexity and makes the extension smaller.
https://github.com/facebook/react-devtools/pull/1224
Thanks to a contribution from Avi Johnson (avijohnson), the deprecated relay classic plugin will no longer be part of future Dev Tools build. This removes complexity and makes the extension smaller.
https://github.com/facebook/react-devtools/pull/1224
GitHub
Remove Relay classic plugin and any reference to Relay by avijohnson · Pull Request #1224 · facebook/react-devtools
With the deprecation, of Relay Classic it no longer makes sense to maintain this plugin.
cc @bvaughn
[Testing]
I follow the existing instructions for test in Chrome, Firefox and standalone, making ...
cc @bvaughn
[Testing]
I follow the existing instructions for test in Chrome, Firefox and standalone, making ...
🔎 Properly Display Hidden, Suspended Subtrees in Dev Tools
The new Profiler inside React Dev Tools now properly displays hidden, suspended subtrees.
https://github.com/facebook/react-devtools/pull/1219
The new Profiler inside React Dev Tools now properly displays hidden, suspended subtrees.
https://github.com/facebook/react-devtools/pull/1219
GitHub
Profiler should properly display hidden, suspended subtrees by bvaughn · Pull Request #1219 · facebook/react-devtools
The behavior of timed-out Suspense trees is unique. Rather than unmount the timed out content (and possibly lose important state) React re-parents this content within a hidden Fragment while the fa...
👷♀️ Allow Production Builds in DOM Fixture
In a contribution from Jan Pöschko (poeschko), the React DOM fixture app used for manually testing multiple React DOM features, now has an option to also test production builds.
https://github.com/facebook/react/pull/13786
In a contribution from Jan Pöschko (poeschko), the React DOM fixture app used for manually testing multiple React DOM features, now has an option to also test production builds.
https://github.com/facebook/react/pull/13786
GitHub
Add a checkbox to fixtures UI to choose React production build by poeschko · Pull Request #13786 · facebook/react
This started out as a part of #13613 which will probably be closed.
🗄 Unique Thread ID for Each Partial Render to Access Contexts
To fix an issue where concurrent partial renders can have an effect on each other, a new unique thread ID is used to access contexts.
https://github.com/facebook/react/pull/14182
To fix an issue where concurrent partial renders can have an effect on each other, a new unique thread ID is used to access contexts.
https://github.com/facebook/react/pull/14182
GitHub
Use unique thread ID for each partial render to access Context by sebmarkbage · Pull Request #14182 · facebook/react
Fixes #13874
Alternative to #13877
This first adds an allocator that keeps track of a unique ThreadID index for each currently executing partial renderer. IDs are not just growing but are reused as...
Alternative to #13877
This first adds an allocator that keeps track of a unique ThreadID index for each currently executing partial renderer. IDs are not just growing but are reused as...
⏳ Scheduler: Use MessageChannel instead of window
The previous implementation of the Scheduler used window.postMessage(). Since this will trigger all message listeners which can impact performance, we’re now using a unique MessageChannel instead.
https://github.com/facebook/react/pull/14234
The previous implementation of the Scheduler used window.postMessage(). Since this will trigger all message listeners which can impact performance, we’re now using a unique MessageChannel instead.
https://github.com/facebook/react/pull/14234
GitHub
[scheduler] Post to MessageChannel instead of window by acdlite · Pull Request #14234 · facebook/react
Scheduler needs to schedule a task that fires after paint. To do this, it currently posts a message event to window. This happens on every frame until the queue is empty. An unfortunate consequence...
⚛️ React Conf Recap
A new blog post is out that summarizes everything that happened during React Conf 2018.
https://reactjs.org/blog/2018/11/13/react-conf-recap.html
A new blog post is out that summarizes everything that happened during React Conf 2018.
https://reactjs.org/blog/2018/11/13/react-conf-recap.html
legacy.reactjs.org
React Conf recap: Hooks, Suspense, and Concurrent Rendering – React Blog
This blog site has been archived. Go to react.dev/blog to see the recent posts. This year’s React Conf took place on October 25 and 26 in Henderson, Nevada, where more than 600 attendees gathered to discuss the latest in UI engineering. Sophie Alpert and…
🎉 React 16.6.3 Patch Release
After a somewhat broken 16.6.2 release, 16.6.3 is out with fixes multiple fixes for Suspense and other new React features.
https://github.com/facebook/react/releases/tag/v16.6.3
After a somewhat broken 16.6.2 release, 16.6.3 is out with fixes multiple fixes for Suspense and other new React features.
https://github.com/facebook/react/releases/tag/v16.6.3
GitHub
Release v16.6.3 · facebook/react
16.6.3 (November 12, 2018)
React DOM
Fix bugs in Suspense and lazy. (@acdlite in #14133, #14157, and #14164)
Fix highlighting of React.memo updates in React DevTools. (@bvaughn in #14141)
Fix inte...
React DOM
Fix bugs in Suspense and lazy. (@acdlite in #14133, #14157, and #14164)
Fix highlighting of React.memo updates in React DevTools. (@bvaughn in #14141)
Fix inte...
✍️ RFC: Context.write
A new RFC is out about adding support for updating managed state outside of the React UI tree that can be shared across multiple React roots.
https://github.com/reactjs/rfcs/pull/89
A new RFC is out about adding support for updating managed state outside of the React UI tree that can be shared across multiple React roots.
https://github.com/reactjs/rfcs/pull/89
GitHub
Context.write by acdlite · Pull Request #89 · reactjs/rfcs
This is a very early stage proposal. I'm opening this RFC as a way to explain the problem space. We're still exploring alternative solutions. If this were an ECMAScript proposal it'd be...
📌 Hooks RFC Merged
After over a thousand comments by community members, the core team now merged the RFC. Check out Sebastian’s closing words to learn more about the issues to address before releasing hooks.
https://github.com/reactjs/rfcs/pull/68#issuecomment-440780509
After over a thousand comments by community members, the core team now merged the RFC. Check out Sebastian’s closing words to learn more about the issues to address before releasing hooks.
https://github.com/reactjs/rfcs/pull/68#issuecomment-440780509
GitHub
RFC: React Hooks by sebmarkbage · Pull Request #68 · reactjs/rfcs
In this RFC, we propose introducing Hooks to React. See the RFC and the documentation for more details.
https://reactjs.org/docs/hooks-overview.html
View formatted RFC
(The talk video has now been ...
https://reactjs.org/docs/hooks-overview.html
View formatted RFC
(The talk video has now been ...
⏳ Reduce Scheduler Serialization Overhead
Jason Miller (developit) helped us to reduce serialization overhead when using postMessage (used inside the Scheduler package). Thank you for your contribution!
https://github.com/facebook/react/pull/14249
Jason Miller (developit) helped us to reduce serialization overhead when using postMessage (used inside the Scheduler package). Thank you for your contribution!
https://github.com/facebook/react/pull/14249
GitHub
Reduce scheduler serialization overhead by developit · Pull Request #14249 · facebook/react
In the process of switching to MessageChannel, it seems the postMessage call was modified to pass "*" (originally the target origin value from window.postMessage). This actually ends up t...
🐢 Monomorphic Object Shape for Stable Builds
Adding properties to an object disables certain optimizations. To prevent this, we don’t add properties to the main React object in stable builds anymore.
https://github.com/facebook/react/pull/14309
Adding properties to an object disables certain optimizations. To prevent this, we don’t add properties to the main React object in stable builds anymore.
https://github.com/facebook/react/pull/14309
GitHub
Prevent deopts from modifying exports object in stable builds by gaearon · Pull Request #14309 · facebook/react
Spiritual successor to #14267.
Only fixes it for stable builds (which IMO is a fair tradeoff).
Only fixes it for stable builds (which IMO is a fair tradeoff).
📝 Versioning Policy Page
A new documentation page now explains our version policy in detail. Keep in mind those changes are not new but it’s great to have them written down.
https://reactjs.org/docs/faq-versioning.html
A new documentation page now explains our version policy in detail. Keep in mind those changes are not new but it’s great to have them written down.
https://reactjs.org/docs/faq-versioning.html
legacy.reactjs.org
Versioning Policy – React
A JavaScript library for building user interfaces
🚿 Clear Fiber Fields to Avoid Memory Leak
To prevent a memory leak, some properties of a fiber are now cleared on unmount.
https://github.com/facebook/react/pull/14276
To prevent a memory leak, some properties of a fiber are now cleared on unmount.
https://github.com/facebook/react/pull/14276
GitHub
Clear fields on unmount of fiber to avoid memory leak by trueadm · Pull Request #14276 · facebook/react
This PR is a follow up to #14218. In that PR, fields that we were unsure about were nulled out. This changes the nulling out of fields to the two that we know are safe to null out – specifically, m...
⚠️ Warn about reassigning this.props
Reassigning this.props during rendering can have undesired effects. A new warning now helps to notice this unsupported behavior.
https://github.com/facebook/react/pull/14277
Reassigning this.props during rendering can have undesired effects. A new warning now helps to notice this unsupported behavior.
https://github.com/facebook/react/pull/14277
GitHub
Warn about reassigning this.props by gaearon · Pull Request #14277 · facebook/react
Related to #14224.
This adds a new warning when you reassign this.props during rendering. This has never been supported but apparently some libraries (like deprecated react-css-modules) do that.
Si...
This adds a new warning when you reassign this.props during rendering. This has never been supported but apparently some libraries (like deprecated react-css-modules) do that.
Si...