Skip to content

Commit b17ab53

Browse files
committed
docs: add inline comments to View component
1 parent 78a740d commit b17ab53

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

  • packages/react-native/Libraries/Components/View

packages/react-native/Libraries/Components/View/View.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ component View(
3030
const hasTextAncestor = use(TextAncestorContext);
3131

3232
let resolvedProps = props;
33+
34+
// When flag is disabled, perform prop transformations of `aria-*`, `id`, and `tabIndex`
35+
// props in JS. When flag is enabled, these transformations are performed faster in C++.
3336
if (!ReactNativeFeatureFlags.enableNativeViewPropTransformations()) {
3437
const {
3538
accessibilityState,
@@ -125,6 +128,8 @@ component View(
125128
<ViewNativeComponent {...resolvedProps} ref={ref} />
126129
);
127130

131+
// If nested within a Text component, reset the ancestor context so that children
132+
// of this view are not treated as text descendants.
128133
if (hasTextAncestor) {
129134
return (
130135
<TextAncestorContext value={false}>{actualView}</TextAncestorContext>

0 commit comments

Comments
 (0)