What's the difference between aws-amplify-react and @aws-amplify/ui-react?
Asked Answered
Q

1

13

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)

What's the difference between them? When should I use aws-amplify-react and when should I use @aws-amplify/ui-react ?

Quevedo answered 1/6, 2020 at 22:43 Comment(0)
Y
15

It looks like aws-amplify-react is the legacy package name and it was changed to @aws-amplify/ui-react in the current version.

amplify legacy react ui lib documentation page

So to answer which to use, use @aws-amplify/ui-react as mentioned in the migration section of the documentation. The documentation is possibly not up to date everywhere.

They have a migration section in the repository README.md file as well:

For aws-amplify-react's Authenticator Component, you will need to import the styles within your app:

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.

Yea answered 1/6, 2020 at 23:6 Comment(3)
Thank you. Those docs of amplify are kind of mess for me, sometimes is hard to find something.Quevedo
It really is a mess. And to me it looks like the "new" package is less flexible when it comes to building a custom Amplify Auth UI ? Extending React Components to build a own UI is not possible anymore but instead it uses "slots"... is that correct or am I missing something?Merissameristem
@Merissameristem I've honestly never used either, I just looked at the documentation to find the answer above.Yea

© 2022 - 2024 — McMap. All rights reserved.