Skip to content

Commit

Permalink
[docs] Recommend setting HTML attribute instead of DOM property for R…
Browse files Browse the repository at this point in the history
…TL (#42599)
  • Loading branch information
aarongarciah authored Jun 14, 2024
1 parent f1fc726 commit c1b78be
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/data/joy/customization/right-to-left/right-to-left.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ Add `dir="rtl"` to the app's root `<html>` tag to set the global text direction:
<html dir="rtl"></html>
```

If your React app doesn't control the root `<html>`, use the JavaScript API before the component tree is rendered, as a workaround:
If you can't set the `dir` attribute directly on the root `<html>` element, as a workaround, use the JavaScript API before the page is rendered:

```js
document.dir = 'rtl';
document.documentElement.setAttribute('dir', 'rtl');
```

#### Locally
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ Add `dir="rtl"` to the app's root `<html>` to set the global text direction:
<html dir="rtl"></html>
```

If your React app doesn't control the root `<html>`, use the JavaScript API before the component tree is rendered, as a workaround:
If you can't set the `dir` attribute directly on the the root `<html>` element, as a workaround, use the JavaScript API before the page is rendered:

```js
document.dir = 'rtl';
document.documentElement.setAttribute('dir', 'rtl');
```

#### Locally
Expand Down

0 comments on commit c1b78be

Please sign in to comment.