mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-25 00:07:47 +01:00
chore: remove node-fetch, don't do Unleash server-side
This commit is contained in:
parent
f49fde0923
commit
6b624081fa
@ -25,7 +25,6 @@
|
||||
"@svgr/webpack": "6.2.1",
|
||||
"clsx": "1.1.1",
|
||||
"file-loader": "6.2.0",
|
||||
"node-fetch": "^2.6.7",
|
||||
"react": "17.0.2",
|
||||
"react-dom": "17.0.2",
|
||||
"unleash-proxy-client": "^1.11.0",
|
||||
|
@ -2,7 +2,6 @@ import React from 'react';
|
||||
import UserFeedback from '@site/src/components/UserFeedback';
|
||||
import { UnleashClient } from 'unleash-proxy-client';
|
||||
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
||||
import nodeFetch from 'node-fetch'
|
||||
|
||||
// Default implementation, that you can customize
|
||||
function Root({ children }) {
|
||||
@ -10,18 +9,11 @@ function Root({ children }) {
|
||||
siteConfig: { customFields },
|
||||
} = useDocusaurusContext();
|
||||
|
||||
|
||||
const unleashSsrOptions = {
|
||||
disableMetrics: true,
|
||||
fetch: nodeFetch
|
||||
}
|
||||
|
||||
const unleashConfig = {
|
||||
clientKey: customFields.unleashProxyClientKey as string,
|
||||
url: customFields.unleashProxyUrl as string,
|
||||
disableRefresh: true,
|
||||
appName: `docs.getunleash.io-${customFields.environment}`,
|
||||
...(typeof fetch === "undefined" ? unleashSsrOptions : {})
|
||||
};
|
||||
|
||||
const [showFeedback, setShowFeedback] = React.useState(false);
|
||||
|
Loading…
Reference in New Issue
Block a user