Skip to content

Commit

Permalink
fix: Fix loading state
Browse files Browse the repository at this point in the history
  • Loading branch information
3y3 committed Feb 27, 2024
1 parent 1368d36 commit ce7e2cb
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/components/DocPage/DocPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,18 @@ type DocPageState = {
class DocPage extends React.Component<DocPageInnerProps, DocPageState> {
static defaultProps: DocSettings = DEFAULT_SETTINGS;

state: DocPageState = {
loading: true,
keyDOM: getRandomKey(),
};

state: DocPageState;
bodyRef: HTMLDivElement | null = null;
bodyObserver: MutationObserver | null = null;

constructor(props: DocPageInnerProps) {
super(props);

this.state = {
loading: props.singlePage,
keyDOM: getRandomKey(),
};
}
componentDidMount(): void {
const {singlePage} = this.props;

Expand Down

0 comments on commit ce7e2cb

Please sign in to comment.