Skip to content

Commit 32d3cda

Browse files
committed
Declare app root element to react-modal
This fixes a warning from react-modal about accessibility issues, previously screen readers would not ignore the root app if the modal was open. More information: http://reactcommunity.org/react-modal/accessibility/
1 parent 9fa5d5c commit 32d3cda

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { StrictMode } from "react";
22
import { createRoot } from "react-dom/client";
3+
import * as Modal from "react-modal";
34

45
import { App } from "./App";
56

@@ -10,6 +11,7 @@ const container = document.getElementById("root");
1011
if (!container) {
1112
throw new Error("Failed to initialize React root, element with id 'root' is null");
1213
}
14+
Modal.setAppElement(container);
1315

1416
const root = createRoot(container);
1517
root.render(

0 commit comments

Comments
 (0)