You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expose unstable_NativeText and unstable_NativeView components (#53777)
Summary:
Pull Request resolved: #53777
Expose `unstable_NativeText` and `unstable_NativeView` components as root exports of the `react-native` package.
These are exposed as `unstable_` APIs which have no semver guarantee.
**Motivation**
There is significant community interest / dependance on the currently private `TextNativeComponent` and `ViewNativeComponent` deep imports, to access the faster-performing inner versions of these UI components.
Using `<Text>` and `<View>`, while recommended and stable, has led to measurable performance overhead in some apps when compared with these `<Native*>` counterparts.
Notably, these APIs are also referenced by low-level libraries such as React Strict DOM.
I am proposing this change in order to:
- Unblock libraries which safely use these.
- Meet users where they are at.
- Unblock us from enabling the Strict TypeScript API (no deep imports).
References:
- react-native-community/discussions-and-proposals#893 (comment)
- https://javascript.plainenglish.io/optimizing-text-component-rendering-in-react-native-b9d3565659d9
- https://github.com/search?type=code&q=react-native%2FLibraries%2FText%2FTextNativeComponent
**Ideal future state**
We are exposing these as unstable APIs because they should not be part of React Native's final API. The ideal end state is we improve the regular `<Text>` and `<View>` components to eliminate performance overhead and the need to access any lower level API.
Changelog:
[General][Added] - `unstable_NativeText` and `unstable_NativeView` are now exported from the `react-native` package
Reviewed By: javache
Differential Revision: D81588145
fbshipit-source-id: 2ea9b7f822286de85f49607944c6a484d1fcf242
0 commit comments