[英]What's the difference between aws-amplify-react and @aws-amplify/ui-react?
I saw many docs and places saying to use aws-amplify-react
but here on the docs to get start with react I saw this package @aws-amplify/ui-react to use the module withAuthentication
(which aws-amplify-react
also has)我看到很多文档和地方都说要使用
aws-amplify-react
但是在文档上开始使用 react 我看到了这个 package @aws-amplify/ui-react来使用模块withAuthentication
(其中aws-amplify-react
也有)
What's the difference between them?他们之间有什么区别? When should I use
aws-amplify-react
and when should I use @aws-amplify/ui-react
?我应该什么时候使用
aws-amplify-react
什么时候应该使用@aws-amplify/ui-react
?
It looks like aws-amplify-react
is the legacy package name and it was changed to @aws-amplify/ui-react
in the current version .看起来
aws-amplify-react
是旧版 package名称,在当前版本中已更改为@aws-amplify/ui-react
。
So to answer which to use, use @aws-amplify/ui-react
as mentioned in the migration section of the documentation.因此,要回答使用哪个,请使用文档迁移部分中提到的
@aws-amplify/ui-react
。 The documentation is possibly not up to date everywhere.文档可能不是所有地方都是最新的。
They have a migration section in the repository README.md
file as well:他们在存储库
README.md
文件中也有一个迁移部分:
For
aws-amplify-react
'sAuthenticator
Component, you will need to import the styles within your app:对于
aws-amplify-react
的Authenticator
组件,您需要在您的应用程序中导入 styles:import '@aws-amplify/ui/dist/style.css';
But even that file isn't completely up to date since it still refers to the legacy version in the installation section.但即使该文件也不是完全最新的,因为它仍然引用安装部分中的旧版本。
It looks like the documentation update is currently in progress, though you could ask for more guidance on the documentation repository .文档更新似乎正在进行中,但您可以在文档存储库中寻求更多指导。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.