gpt4 book ai didi

reactjs - Amplify UI 在 React js 中无法正常工作

转载 作者:行者123 更新时间:2023-12-03 08:13:03 25 4
gpt4 key购买 nike

我正在使用 AWS amplify 进行用户身份验证。 UI 与预期不符,但功能没有问题。

enter image description here

增强依赖关系

"dependencies": {
"@aws-amplify/ui-react": "^2.1.4",
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"aws-amplify": "^4.3.10",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-scripts": "4.0.3",
"web-vitals": "^1.0.1"
}

我的app.js

import logo from "./logo.svg";
import "./App.css";
import Amplify from "aws-amplify";
import awsconfig from "./aws-exports";
import { withAuthenticator } from "@aws-amplify/ui-react";
Amplify.configure(awsconfig);

function App() {
return (
<div className="App">
<header className="App-header">
{/* <AmplifySignOut /> */}
<h2>Amplify App</h2>
</header>
</div>
);
}

export default withAuthenticator(App);

最佳答案

最新版本的 Amplify 支持以下样式表

import '@aws-amplify/ui-react/styles.css';

更多详情请访问Official AMPLIFY documents

关于reactjs - Amplify UI 在 React js 中无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70319172/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com