我看到很多文档和地方说要使用 aws-amplify-react
但是在文档中开始使用 react 我看到了这个包 @aws-amplify/ui-react使用模块withAuthentication
(aws-amplify-react
也有)
他们之间有什么区别?我什么时候应该使用 aws-amplify-react
什么时候应该使用@aws-amplify/ui-react
?
最佳答案
看起来像 aws-amplify-react
is the legacy package名称并更改为 @aws-amplify/ui-react
in the current version .
所以要回答使用哪个,请使用 @aws-amplify/ui-react
如 migration section of the documentation. 中所述文档可能不是所有地方都是最新的。
他们有一个 migration section在存储库中 README.md
文件:
For
aws-amplify-react
'sAuthenticator
Component, you will need to import the styles within your app:import '@aws-amplify/ui/dist/style.css';
但即使该文件也不是完全最新的,因为它仍然引用安装部分中的旧版本。
看起来文档更新正在进行中,但您可以在 documentation repository 上寻求更多指导。 .
关于javascript - aws-amplify-react 和 @aws-amplify/ui-react 有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62142118/