aws-amplify / aws-amplify/docs

[Feedback]CLI > Authentication > Admin Actions: react example outdated

Open
#5,180 0 comments 0 reactions 0 assignees View on GitHub
amplify/cli p2
Dominant language
MDX
Stars
506
Forks
1.1k
Avg merge
3h 14m
Merged PRs (30d)
1

Description

**Page**: [`/cli/auth/admin`](https://docs.amplify.aws/cli/auth/admin)

**Feedback**:

The current JS(React) example for the Admin actions section of the CLI uses some outdated information.

1. `import React from 'react'` is [no longer necessary ](https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html#removing-unused-react-imports)
2. `import { withAuthenticator } from 'aws-amplify-react'` is using a [deprecated package](https://www.npmjs.com/package/aws-amplify-react), this package was [deprecated in v5](https://github.com/aws-amplify/amplify-js/releases/tag/aws-amplify%405.0.0) of the Amplify JS library. It should now show the import to come from the UI package, `@aws-amplify/ui-react`
3. the last line shows `withAuthenticator` passing 2 arguments, but the 2nd is [not required in the new UI package](https://ui.docs.amplify.aws/react/connected-components/authenticator#step-3-add-the-authenticator)
4. maybe we should add the styles import if we are going to add in the Authenticator component? `import '@aws-amplify/ui-react/styles.css';`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.