2.0.0-alpha.2 • Published 4 years ago

amplify-react-router v2.0.0-alpha.2

Weekly downloads
7
License
MIT
Repository
github
Last release
4 years ago

amplify-react-router

Router Wrapper around the Authenticator from aws-amplify-react

NPM License Code Style CircleCI

Having to rely on local authState is a pain the butt when you want to use a router as well as overriding the default components. This component makes that even easier now.

Installation

yarn add amplify-react-router aws-amplify-react aws-amplify react-router-dom

Usage

import React from 'react';
import AmplifyRouter from 'amplify-react-router';
import { Router, navigate } from '@reach/router';
import MySignIn from './SignIn';
import Page from './Page';
import awsExports from './aws-exports';

export default () => (
    <AmplifyRouter
        amplifyConfig={awsExports}
        homeRoute="/home"
        navigate={navigate}
        componentOverrides={[MySignIn]}
    >
    <Router>
        <Page path="/home" />
    </Router>
</AmplifyRouter>
);

You no longer have to pass in the hide property for components you want to override. Only pass in the components to the hide prop that you want to actually hide.

All overriden components should be placed in the componentOverrides and will auto hide their super class s component.

Props

All the base Authenticator Props plus the below.

Prop NameTypesDefaultDescription
componentOverridesArray(Component)OptionalThe auth components you want to override
homeRouteString/The home route to navigate to when once signed in
navigate(route: string) => voidFunction that takes new route to optionally push to history api for router.
2.0.0-alpha.2

4 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.9-alpha.6

5 years ago

1.0.9-alpha.5

5 years ago

1.0.9-alpha.4

5 years ago

1.0.9-alpha.3

5 years ago

1.0.9-alpha.2

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago