Codemods

The American Express Design System provides a unified language for designing American Express websites and experiences. The design system provides design resources that match our coded components and are aligned with the American Express brand. Included are colors, components, icons and glyphs, type styles, and graphic assets to get you up and running quickly.

Back to All Codemods

OverflowMenuNavigation Transform

Converts a v6 OverflowMenuNavigation component to a v7 MenuItem component.

Automatic Changes

  • Attempts to transform the deprecated theme prop to the className prop. If it cannot, deletes the theme prop.
  • Renames the import and usages of OverflowMenuNavigation to MenuItem.
  • Removes the href prop, which has been deprecated.

For example:

import { OverflowMenuNavigation } from '@americanexpress/dls-react6';

export default function Page() {

return (

<OverflowMenuNavigation

href="/"

onClick={handleOnClick}

theme={{ color: 'red' }}

{...otherProps}

>

{/** Children */}

</OverflowMenuNavigation>

);

}

Transforms into:

import { MenuItem } from '@americanexpress/dls-react';

export default function Page() {

return (

<MenuItem onClick={handleOnClick} {...otherProps}>

{/** Children */}

</MenuItem>

);

}

Manual Changes

href is deprecated.

Previously, OverflowMenu items could be OverflowMenuNavigation which used <a> tags. In v7, MenuItem does not support href props as it’s a <button>. The v7 Menu component is designed for grouping actions rather than navigation. Consider one of the navigation components for a dropdown navigation.

Questions?

Connect with the DLS Team on Slack or by email.

Resources

Check out additional resources.