- Navigate to the root of your local clone of aws-amplify/amplify-ui
- Run
yarn setup
- Run
yarn react dev
This will start building @aws-amplify/ui-react
in watch mode. To test your changes, you can utilize examples/next
to run examples on next.js
. Please see examples README and e2e README to get started.
@aws-amplify/ui-react
depends on @aws-amplify/ui
for theming, state management, and translation logic. If you're looking for change in these, please refer to @aws-amplify/ui
README.
Separate all imports into organized, alphabetical blocks of third_party → internal → local
for easier reading.
import { isEmpty } from 'lodash/isEmpty';
import * as React from 'react';
import { Auth } from 'aws-amplify';
import { Button } from './primitives/Button';
import { THIS_ENUM } from './utils/types';
Do NOT use implicit paths like below. This can lead to circular dependencies unintentionally which is bad for tree shaking.
import { Flex, Heading } from '../../..';
Use explicit import paths instead, the more specific the better.
import { Flex } from '../../../primitives/Flex';
import { Heading } from '../../../primitives/Heading';
- Component names should be capitalized.
- Boolean props should be prefixed with
is
and default tofalse
.
Do NOT introduce any side effects unless you have to with rational reasons. A "side effect" is defined as code that performs a special behavior when imported, other than exposing one or more exports. An example of this are polyfills, which affect the global scope and usually do not provide an export. For example:
import './polyfill';
Any imported file is subject to tree shaking, that means CSS file needs to be added to the side effect list so it will not be unintentionally dropped:
import './style.css';
After you tested your change, you can run yarn react build
from monorepo to run build for production.