Skip to content

Commit

Permalink
fix: Scrolling keeps rewriting url after a Redoc element was removed #…
Browse files Browse the repository at this point in the history
  • Loading branch information
Oprysk authored Jul 19, 2022
1 parent 7cc0500 commit 0045be0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
13 changes: 0 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion src/standalone.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { hydrate as hydrateComponent, render } from 'react-dom';
import { hydrate as hydrateComponent, render, unmountComponentAtNode } from 'react-dom';
import { configure } from 'mobx';

import { Redoc, RedocStandalone } from './components/';
Expand Down Expand Up @@ -74,6 +74,12 @@ export function init(
);
}

export function destroy(element: Element | null = querySelector('redoc')): void {
if (element) {
unmountComponentAtNode(element);
}
}

export function hydrate(
state: StoreState,
element: Element | null = querySelector('redoc'),
Expand Down

0 comments on commit 0045be0

Please sign in to comment.