qpp-style 1.34.0-rm.0 → 1.34.0-rm.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { render } from "react-dom";
1
+ import { createRoot } from "react-dom/client";
2
2
  import ErrorUI from "./ErrorUI";
3
3
 
4
4
  /**
@@ -13,13 +13,13 @@ export default class ErrorPage {
13
13
  * @param {HTMLElement} options.rootElement - Elem inside which to render
14
14
  */
15
15
  constructor(options) {
16
- render(
16
+ const root = createRoot(options.rootElement);
17
+ root.render(
17
18
  <ErrorUI
18
19
  type={options.type}
19
20
  code={options.code}
20
21
  message={options.message}
21
22
  />,
22
- options.rootElement,
23
23
  );
24
24
  }
25
25
  }
@@ -1,4 +1,4 @@
1
- import { render } from "react-dom";
1
+ import { createRoot } from "react-dom/client";
2
2
  import FooterUI from "./FooterUI";
3
3
 
4
4
  /**
@@ -11,9 +11,11 @@ export default class Footer {
11
11
  */
12
12
  constructor(options) {
13
13
  if ("rootElement" in options) {
14
- render(<FooterUI />, options.rootElement);
14
+ const root = createRoot(options.rootElement);
15
+ root.render(<FooterUI />);
15
16
  } else {
16
- render(<FooterUI />, options);
17
+ const root = createRoot(options);
18
+ root.render(<FooterUI />);
17
19
  }
18
20
  }
19
21
  }
@@ -1,4 +1,4 @@
1
- import { render } from "react-dom";
1
+ import { createRoot } from "react-dom/client";
2
2
  import HeaderUI from "./HeaderUI.jsx";
3
3
 
4
4
  /**
@@ -16,7 +16,8 @@ export default class Header {
16
16
  * @param {HTMLElement} options.rootElement - Elem inside which to render
17
17
  */
18
18
  constructor(options) {
19
- render(
19
+ const root = createRoot(options.rootElement);
20
+ root.render(
20
21
  <HeaderUI
21
22
  isLoginEnabled={options.isLoginEnabled}
22
23
  skipToContentId={options.skipToContentId}
@@ -33,7 +34,6 @@ export default class Header {
33
34
  content={options.content}
34
35
  isIESupportPage={options.isIESupportPage}
35
36
  />,
36
- options.rootElement,
37
37
  );
38
38
  }
39
39
  }
@@ -1,5 +1,5 @@
1
1
  import { Component } from "react";
2
- import { render } from "react-dom";
2
+ import { createRoot } from "react-dom/client";
3
3
  import ReactModal from "react-modal";
4
4
  import { CloseXIcon } from "../../lib/SvgComponents.jsx";
5
5
  import SanitizedContent from "../SanitizedContent";
@@ -61,7 +61,8 @@ class Modal extends Component {
61
61
  }
62
62
 
63
63
  const displayModal = ({ content, main }) => {
64
- render(<Modal content={content} showModal={true} />, main);
64
+ const root = createRoot(document.getElementById("root"));
65
+ root.render(<Modal content={content} showModal={true} />, main);
65
66
  };
66
67
 
67
68
  Modal.propTypes = {
@@ -1,4 +1,4 @@
1
- import { render } from "react-dom";
1
+ import { createRoot } from "react-dom/client";
2
2
  import SessionDialogUI from "../Session";
3
3
 
4
4
  /**
@@ -6,6 +6,7 @@ import SessionDialogUI from "../Session";
6
6
  */
7
7
  export default class SessionDialog {
8
8
  constructor(options) {
9
- render(<SessionDialogUI />, options.rootElement);
9
+ const root = createRoot(options.rootElement);
10
+ root.render(<SessionDialogUI />);
10
11
  }
11
12
  }
@@ -1,4 +1,4 @@
1
- import { render } from "react-dom";
1
+ import { createRoot } from "react-dom/client";
2
2
  import { SideNavUI } from "./UI";
3
3
 
4
4
  const SideNav = (options = {}) => {
@@ -12,7 +12,8 @@ const SideNav = (options = {}) => {
12
12
  rootElement,
13
13
  } = options;
14
14
 
15
- return render(
15
+ const root = createRoot(rootElement);
16
+ return root.render(
16
17
  <SideNavUI
17
18
  onExpanded={onExpanded}
18
19
  onCollapsed={onCollapsed}
@@ -21,7 +22,6 @@ const SideNav = (options = {}) => {
21
22
  items={items}
22
23
  isAltStyle={isAltStyle}
23
24
  />,
24
- rootElement,
25
25
  );
26
26
  };
27
27