website: dynamically load rapidoc to prevent react errors

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-04-18 17:58:36 +02:00
parent a074ea70e9
commit 828fe07fca

View file

@ -2,11 +2,11 @@ import React from "react";
import Layout from "@theme/Layout"; import Layout from "@theme/Layout";
import useDocusaurusContext from "@docusaurus/useDocusaurusContext"; import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
import useBaseUrl from "@docusaurus/useBaseUrl"; import useBaseUrl from "@docusaurus/useBaseUrl";
import "rapidoc";
function APIBrowser() { function APIBrowser() {
const context = useDocusaurusContext(); const context = useDocusaurusContext();
const { siteConfig = {} } = context; const { siteConfig = {} } = context;
import('rapidoc');
return ( return (
<Layout title="API Browser" description={siteConfig.tagline}> <Layout title="API Browser" description={siteConfig.tagline}>
<rapi-doc <rapi-doc