pedrojpj/recompose-extends

View on GitHub
example/withCustomError.js

Summary

Maintainability
A
0 mins
Test Coverage
import React from 'react';
import { compose, pure } from 'recompose';
import { withErrors } from '../src/index';

const WithErrors = ({ example }) => <div>{example()}</div>;

const CustomError = () => (
  <div className="alert alert-danger" role="alert">
    <strong>Oh snap!</strong> Change a few things up and try submitting again.
  </div>
);

export default compose(withErrors({ debug: true }, CustomError), pure)(
  WithErrors
);