Search code examples
javascriptreactjsaws-amplifyamplifyjs

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)

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


Solution

  • 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.