mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-27 05:28:43 +02:00
refactor(pwa): simplify registerSW code, fix ESLint errors (#7579)
This commit is contained in:
parent
bada5c11cc
commit
7869e74fd7
14 changed files with 204 additions and 247 deletions
|
@ -20,8 +20,9 @@ const createContainer = () => {
|
|||
return container;
|
||||
};
|
||||
|
||||
export default async function renderReloadPopup(props: Props): Promise<void> {
|
||||
export default function renderReloadPopup(props: Props): Promise<void> {
|
||||
const container = getContainer() ?? createContainer();
|
||||
const ReloadPopup = (await import('@theme/PwaReloadPopup')).default;
|
||||
ReactDOM.render(<ReloadPopup {...props} />, container);
|
||||
return import('@theme/PwaReloadPopup').then(({default: ReloadPopup}) => {
|
||||
ReactDOM.render(<ReloadPopup {...props} />, container);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue