How to use the @airbnb/lunar/lib/prop-types/componentName.isRequired function in @airbnb/lunar

To help you get started, we’ve selected a few @airbnb/lunar examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github airbnb / lunar / packages / app-shell / src / index.tsx View on Github external
children: NonNullable;
  /** Name of the entire application or project. */
  name: string;
};

export type State = {
  breadcrumbs: Breadcrumb[];
  data: { [id: string]: object };
  toasts: Toast[];
};

export { AppContext };

export class AppShell extends React.Component {
  static propTypes = {
    name: componentName.isRequired,
  };

  static defaultProps = {
    name: Core.settings.name,
  };

  state = {
    breadcrumbs: [],
    data: {},
    toasts: [],
  };

  addBreadcrumb = (label: string, props: Breadcrumb['props'] = {}) => {
    const id = uuid();

    this.setState(prevState => ({