mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-06 08:50:50 +08:00
fix: remove unused hooks (#2762)
(cherry picked from commit a421265483)
This commit is contained in:
@@ -13,7 +13,7 @@ import type { AppProps } from 'next/app';
|
|||||||
import Head from 'next/head';
|
import Head from 'next/head';
|
||||||
import { useRouter } from 'next/router';
|
import { useRouter } from 'next/router';
|
||||||
import type { PropsWithChildren, ReactElement } from 'react';
|
import type { PropsWithChildren, ReactElement } from 'react';
|
||||||
import React, { lazy, Suspense, useEffect, useMemo } from 'react';
|
import React, { lazy, Suspense } from 'react';
|
||||||
|
|
||||||
import { AffineErrorBoundary } from '../components/affine/affine-error-eoundary';
|
import { AffineErrorBoundary } from '../components/affine/affine-error-eoundary';
|
||||||
import { MessageCenter } from '../components/pure/message-center';
|
import { MessageCenter } from '../components/pure/message-center';
|
||||||
@@ -41,6 +41,11 @@ const DebugProvider = ({ children }: PropsWithChildren): ReactElement => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const i18n = createI18n();
|
||||||
|
if (process.env.NODE_ENV === 'development') {
|
||||||
|
console.log('Runtime Preset', config);
|
||||||
|
}
|
||||||
|
|
||||||
const App = function App({
|
const App = function App({
|
||||||
Component,
|
Component,
|
||||||
pageProps,
|
pageProps,
|
||||||
@@ -49,14 +54,6 @@ const App = function App({
|
|||||||
emotionCache?: EmotionCache;
|
emotionCache?: EmotionCache;
|
||||||
}) {
|
}) {
|
||||||
const getLayout = Component.getLayout || EmptyLayout;
|
const getLayout = Component.getLayout || EmptyLayout;
|
||||||
const i18n = useMemo(() => createI18n(), []);
|
|
||||||
if (process.env.NODE_ENV === 'development') {
|
|
||||||
// I know what I'm doing
|
|
||||||
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
||||||
useEffect(() => {
|
|
||||||
console.log('Runtime Preset', config);
|
|
||||||
}, []);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<CacheProvider value={emotionCache}>
|
<CacheProvider value={emotionCache}>
|
||||||
|
|||||||
Reference in New Issue
Block a user