Что-то про React – Telegram
Что-то про React
300 subscribers
3 photos
498 links
Немного про React.
Список статей и новостей подбирается полностью вручную.
Download Telegram
Remove Feature Flag to Disable Yielding
The feature flag added to disable yielding in Concurrent Mode was superset by the new Batched Mode.

https://github.com/facebook/react/pull/15654
🎨 Use !important to Hide Suspended Nodes
To make sure suspended nodes are hidden even if custom CSS would overwrite it, it’s now using !important using style.setProperty.

https://github.com/facebook/react/pull/15861
When to useMemo and useCallback

Performance optimizations ALWAYS come with a cost but do NOT always come with a benefit. In this post Kent breaks down those costs (and benefits) of useMemo and useCallback.
react-redux v7.1.0 released

react-redux v7.1.0 (the one with Hooks) was released this week.
🎇 Rethinking Focus
In this GitHub issue, the team outlines a proposal that rethinks how focus is managed in React apps. Get involved!

https://github.com/facebook/react/issues/16009
🎬 SuspenseList
A new <SuspenseList> component can be used to coordinate the loading sequence of nested suspense boundaries. It includes backwards and forwards options and the ability to expire rendering of the tail after a timeout.

https://github.com/facebook/react/pull/15902
Scheduler: Delay Option
A new option was added to the scheduler API to allow callbacks to only run after a specific delay has passed.

https://github.com/facebook/react/pull/15911
⚛️🛠 Experimental DevTools: Owner Tree
Check out this Twitter thread by Brian to learn more about the Owner Tree view coming to the new DevTools. The team is also working on React Native support.

https://twitter.com/brian_d_vaughn/status/1144262284912582657
Scheduler: Use isInputPending()
isInputPending(), a new API to check if the browser has events enqueued, is now used inside the Scheduler behind a feature flag.

https://github.com/facebook/react/pull/15911
🧪 Warn If Passive Effects Get Queued Outside of act()
With this change, React will now warn when effects are queued outside of an act() call.

https://github.com/facebook/react/pull/15763
Scheduler: requestPaint()
The requestPaint() API is used by React to signalize the Scheduler that it needs to yield to let the browser paint the page. This is necessary since the new use of isInputPending() would otherwise cause the Scheduler to run more low-priority work.

https://github.com/facebook/react/pull/15960
🧽 Construct Error at Invariant Call Site
Invariant Errors are now constructed directly at call site to remove one level of the call stack.

https://github.com/facebook/react/pull/15877
🔎 Support for ESLint 6.0.0
Thanks to a contribution by Thomas Broyer, the ESLint plugin now works with 6.0.0

https://github.com/facebook/react/pull/15974
🐌 Slightly Improve Performance of Hydration
By avoiding loading a property from the same node multiple times in a row, hydration is now a little bit faster.

https://github.com/facebook/react/pull/15998
🙅‍♀️ Fix Error Logging in getDerivedStateFromProps
This PR fixes a bug in getDerivedStateFromError where errors are not logged when an error occurs.

https://github.com/facebook/react/pull/15797
🎇 React Flare Updates
These changes (and more) have been made to React Flare:
React Native Fabric Support.
useEvent() and responder specific hooks were added.
Event targets were removed.
🔄 React Fresh Updates
Track Mounted Roots via DevTools Hook.
• The babel plugin now throws when applied in production.
• Require-like calls are no longer considered to be HOCs.
Announcing styled-components v5: Beast Mode

50% faster server-side rendering, 20% faster client-side rendering, 19% smaller bundle size, RTL support and no breaking changes!
Add useEvent hook implementation

This PR adds a new primitive hook to React called useEvent. For now it's behind the React Flare flag and is labelled unstabled_useEvent on the React object. This implementation might have bugs in, as it's not been hooked up and tested with the various event responder modules, like Press, Hover etc. This isn't intended to be a bug-free PR, more it's an initial implementation that should aim to get the wiring right between fibers and the hook.