Error: supportedChain is deprecated, please pass networks instead

Error: supportedChain is deprecated, please pass networks instead

我正在阅读关于为以太坊智能合约创建前端的 freecodecamp Patrick Collins 教程,我不知道为什么当我打开本地主机控制台时出现错误。

supportedChain is deprecated, please pass networks instead

我已经安装了 metamask/detect 提供程序

npm i @metamask/detect-provider

这里是 app.tsx 脚本:

import './App.css';
import { DAppProvider, ChainId, useEthers, Config, Kovan} from '@usedapp/core';
import {Header} from "./components/Header";
import { YourWallet } from './components/yourWallet';
import {Container} from "@material-ui/core";
import { Main } from "./components/Main";


function App() {
  return (
    <DAppProvider config={{
      supportedChains: [ChainId.Kovan], 
      notifications: {
        expirationPeriod: 1000, 
        checkInterval: 1000
      }
    }}>
      <Container maxWidth="md">
      <Header />
      <Main />
        
      </Container>
      
    </DAppProvider>
  );
}

export default App;

如果有人能帮忙,那真的很有帮助:)

错误很明显。而不是 supportedChains 使用 networks

function MyApp({ Component, pageProps }: AppProps) {
  return (
    <DAppProvider
      config={{
        networks: [Kovan],
        notifications: {
          expirationPeriod: 1000,
          checkInterval: 100,
        },
      }}
    >
      <Component {...pageProps} />
    </DAppProvider>
  );
}