Skip to content

Commit

Permalink
React render => createRoot
Browse files Browse the repository at this point in the history
  • Loading branch information
slorber committed Oct 24, 2024
1 parent 2c43fa6 commit 7fd39ce
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/docusaurus-plugin-pwa/src/renderReloadPopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import React from 'react';
import ReactDOM from 'react-dom';
import {createRoot} from 'react-dom/client';
import type {Props} from '@theme/PwaReloadPopup';

const POPUP_CONTAINER_ID = 'pwa-popup-container';
Expand All @@ -23,6 +23,7 @@ const createContainer = () => {
export function renderReloadPopup(props: Props): Promise<void> {
const container = getContainer() ?? createContainer();
return import('@theme/PwaReloadPopup').then(({default: ReloadPopup}) => {
ReactDOM.render(<ReloadPopup {...props} />, container);
const root = createRoot(container);
root.render(<ReloadPopup {...props} />);
});
}

0 comments on commit 7fd39ce

Please sign in to comment.