Knowledge of directionality is required.
DirectionProvider is available for controlling the direction of a target React component tree.
While not necessary to render at the root, since the default direction is inferred from the device,
it can be used to explicitly enforce a direction, like so.
value prop can be used to dynamically change the direction of a provider based on a user
provided string. For example, say we have a message thread, and we want to swap between LTR and RTL
depending on what's being entered in an input field.
As demonstrated above, if the user is typing in English, the direction would be
ltr, otherwise, if
the user is typing in Arabic, the direction would be
rtl, so on and so forth.
To manually access the current direction, either from the document or a provider, use the
useDirection() hook or