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
However and as stated before, those styles will have a lower specificity than tags, classes and
101
+
ID styles and as such, these are not "real" CSS selectors. Hopefully, CSS selectors will be
102
+
implemented at some point, [you can upvote the feature request here](https://native-html.canny.io/features/p/support-complex-css-like-selectors-eg-div-button)!
103
+
The hard challenge is that these should not impede performances. I am planning to explore this issue next year.
104
+
84
105
:::warning
85
106
Beware that this `tnode` is an instance of <APIReferencename="TNodeDescriptor"
86
107
/>, which is a minimal `tnode` shape available during the Transient Render
@@ -93,15 +114,15 @@ to query the DOM and create your conditional styling rules.
93
114
94
115
### `reactNativeProps`
95
116
96
-
This field will set props to the native component during the rendering phase. It is an object with three optional properties:
117
+
This field will set props to the native component during the rendering phase.
118
+
It is an object with three optional properties (for reference, the shape of
119
+
this object is a <APIReferencename="ReactNativePropsDefinitions" />):
97
120
98
121
1.`text`, to pass native props to the `Text` component when the renderer is textual;
99
122
2.`view`, to pass native props to the `View` component when the renderer is block;
100
123
3.`native`, to pass props to either `View` or `Text` components, irrespective of the renderer type.
101
124
102
-
The type definition for this object is <APIReferencename="ReactNativePropsDefinitions" />.
103
-
104
-
In the below example, we are defining a custom tag, `nav-widget`, and setting
125
+
In the next snippet, we are defining a custom tag, `<nav-widget>`, and setting
105
126
accessibility props to any underlying native component for the render phase. We
106
127
can also define `onPress`, which will cause the renderer to use the
107
128
​<APIReferencename="RenderHTMLProps"member="GenericPressable" /> instead of
@@ -189,18 +212,46 @@ Don't forget that you can mix model-based and component-based rendering!
189
212
190
213
## A Focus on Accessibility
191
214
192
-
### Support for `aria-label` and `aria-role` Attributes
215
+
Screen readers integration has been worked on sparsely since the Foundry
216
+
release, by addressing issues raised by the community, but until v6.2 there has
217
+
not been structural improvements to cover the full range of required features.
218
+
Thanks to the new Transient Render Engine, it has become very easy to define
219
+
translations from HTML attributes to React Native props within the engine.
220
+
Let's find out what's new!
221
+
222
+
### Support for `aria-label` and `role` Attributes
223
+
224
+
On one hand, <Referencetype="html-attr"url="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute"name="aria-label" />
225
+
is used to hint screen readers on how a specific node **and all its descendants** should be read out loud. It is especially
226
+
useful to handle icons which don't have inner semantic meanings. This attribute has a React Native prop equivalent, namely
227
+
[`accessibilityLabel`](https://reactnative.dev/docs/accessibility#accessibilitylabel), which serves the same purpose.
228
+
On the other hand, <Referencetype="html-attr"url="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles"name="role" />
229
+
informs the screen reader of the target element nature and how a user might interact with it.
230
+
This attributes roughly maps to React Native [`accessibilityRole`](https://reactnative.dev/docs/accessibility#accessibilityrole)
231
+
prop, although the set of allowed values slightly differs.
0 commit comments