Inside component
Oops, that didn't work. Try again.

Purpose

ErrorContainers handle displaying inline errors as close to the source of the error (and the action to resolve it) as possible. For example, ErrorContainer can be wrapped around a Button component that calls a GraphQL mutation. See the Errors page for more information on how to handle general errors.

Guidance

Wrap your component with the ErrorContainer to highlight when an error occurs.

Usage

import { ErrorContainer } from '@loomhq/lens'
<ErrorContainer errorActive={true}>{children}</ErrorContainer>

Examples

Standard

With custom error message

Props

name
type
default
errorMessage
string
"Oops, that didn't work. Try again."
children
React.ReactNode
required
errorActive
boolean
required