mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2025-12-27 05:00:30 +08:00
disable annoying warnings
This commit is contained in:
parent
e68411a020
commit
713530cae3
@ -3,9 +3,9 @@ import ReactDOM from 'react-dom/client'
|
|||||||
import { BrowserRouter } from 'react-router-dom'
|
import { BrowserRouter } from 'react-router-dom'
|
||||||
import { ThemeProvider as NextThemesProvider } from 'next-themes'
|
import { ThemeProvider as NextThemesProvider } from 'next-themes'
|
||||||
import { NextUIProvider } from '@nextui-org/react'
|
import { NextUIProvider } from '@nextui-org/react'
|
||||||
|
import '@renderer/utils/init'
|
||||||
import App from './App'
|
import '@renderer/assets/main.css'
|
||||||
import './assets/main.css'
|
import App from '@renderer/App'
|
||||||
|
|
||||||
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
|
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
|
||||||
<React.StrictMode>
|
<React.StrictMode>
|
||||||
|
|||||||
15
src/renderer/src/utils/init.ts
Normal file
15
src/renderer/src/utils/init.ts
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
|
const originError = console.error
|
||||||
|
const originWarn = console.warn
|
||||||
|
console.error = function (...args: any[]): void {
|
||||||
|
if (typeof args[0] === 'string' && args[0].includes('validateDOMNesting')) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
originError.call(console, args)
|
||||||
|
}
|
||||||
|
console.warn = function (...args): void {
|
||||||
|
if (typeof args[0] === 'string' && args[0].includes('aria-label')) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
originWarn.call(console, args)
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user