Skip to content

Latest commit

 

History

History
24 lines (18 loc) · 432 Bytes

Catch.md

File metadata and controls

24 lines (18 loc) · 432 Bytes

Catch

React componentDidCatch component that displays errors. Wrap it around other components that might error like a LiveEditor or a fetch.

import React from 'react'
import { Catch } from '@compositor/kit'
import Button from '../src/Button'

export default props => (
  <Catch>
    <Button>Hello</Button>
  </Catch>
)

Example

Here a ReferenceError is being caught.

<Catch>{imNotDefined}</Catch>