Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version Packages #1195

Merged
merged 1 commit into from
Jan 27, 2022
Merged

Version Packages #1195

merged 1 commit into from
Jan 27, 2022

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Jan 26, 2022

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

@aws-amplify/[email protected]

Minor Changes

  • #1168 b32dd86bf Thanks @wlee221! - This enables useAuthenticator usage outside to access commonly requested authenticator context like user and route.

    First wrap your App with Authenticator.Provider:

    const App = (
      <Authenticator.Provider>
        <MyApp />
      </Authenticator.Provider>
    );

    To avoid repeated re-renders, you can pass a function that takes in Authenticator context and returns an array of desired context values. This hook will only trigger re-render if any of the array value changes.

    const Home = () => {
      const { user, signOut } = useAuthenticator((context) => [context.user]);
    
      return (
        <>
          <h2>Welcome, {user.username}!</h2>
          <button onClick={signOut}>Sign Out</button>
        </>
      );
    };
    
    const Login = () => <Authenticator />;
    
    function MyApp() {
      const { route } = useAuthenticator((context) => [context.route]);
    
      return route === 'authenticated' ? <Home /> : <Login />;
    }

Patch Changes

@aws-amplify/[email protected]

Patch Changes

@aws-amplify/[email protected]

Patch Changes

@aws-amplify/[email protected]

Patch Changes

@github-actions github-actions bot force-pushed the changeset-release/main branch 10 times, most recently from 21ace3a to bb586f4 Compare January 27, 2022 20:20
@github-actions github-actions bot force-pushed the changeset-release/main branch from bb586f4 to d81e9c7 Compare January 27, 2022 21:56
@wlee221 wlee221 added the run-tests Adding this label will trigger tests to run label Jan 27, 2022
@github-actions github-actions bot removed the run-tests Adding this label will trigger tests to run label Jan 27, 2022
@wlee221 wlee221 temporarily deployed to ci January 27, 2022 22:06 Inactive
@wlee221 wlee221 temporarily deployed to ci January 27, 2022 22:06 Inactive
@wlee221 wlee221 temporarily deployed to ci January 27, 2022 22:06 Inactive
@wlee221 wlee221 temporarily deployed to ci January 27, 2022 22:06 Inactive
@wlee221 wlee221 merged commit 65c188f into main Jan 27, 2022
@wlee221 wlee221 deleted the changeset-release/main branch January 27, 2022 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant