gpt4 book ai didi

reactjs - 使用 Amplify 实现的登录表单未应用样式

转载 作者:行者123 更新时间:2023-12-03 19:42:33 26 4
gpt4 key购买 nike

我在日语论坛上问了同样的问题,但没有得到答复,所以我在这个网站上提问。

这个问题是关于 AWS Amplify。

我正在尝试使用 Amplify 的 React 和 withAuthenticator() 实现登录表单,引用 AWS( https://aws-amplify.github.io/docs/js/authentication ) 的文档,
但是我的登录表单不像文档的示例 UI,并且 css 没有像下图这样应用。

我可以登录和注册。

有什么办法可以解决这个问题吗?

my login form made by withAuthenticator()

import Amplify from 'aws-amplify';
import awsconfig from './aws-exports';
import { withAuthenticator } from 'aws-amplify-react';

Amplify.configure(awsconfig);

function App() {
return (

);
}

export default withAuthenticator(App);

我清除了缓存但没有工作。

Chrome 的开发工具也没有错误。

对不起,我的英语不好。

最佳答案

尝试使用 @aws-amplify/ui-react而不是 aws-amplify-react .

import { withAuthenticator } from '@aws-amplify/ui-react';

关于reactjs - 使用 Amplify 实现的登录表单未应用样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61159622/

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