@bearei/react-error
TypeScript icon, indicating that this package has built-in type declarations

0.0.6 • Public • Published

react-error

Base error components that support React and React native

Installation

yarn add @bearei/react-error --save

Parameters

Name Type Required Description
defaultImage ReactNode Default image of error page
title ReactNode Error page title
tip ReactNode Error page alert message
button ReactNode Error page custom button
buttonText string Error page button text
onClick (e: React.MouseEvent) => void This function is called when button is clicked
onTouchEnd (e: React.TouchEvent) => void This function is called when the button is pressed
onPress (e: GestureResponderEvent) => void This function is called when the button is pressed -- react native
renderMain (props: ErrorMainProps) => ReactNode Render the error main
renderContainer (props: ErrorContainerProps) => ReactNode Render the error container

Use

import React from 'React';
import ReactDOM from 'react-dom';
import Icon from '@bearei/react-error';

const error = (
  <Error
    renderMain={() => <i>{'error'}</i>}
    renderContainer={({ id, children }) => <div>{children}</div>}
  />
);

ReactDOM.render(error, container);

Package Sidebar

Install

npm i @bearei/react-error

Weekly Downloads

0

Version

0.0.6

License

MIT

Unpacked Size

45.6 kB

Total Files

11

Last publish

Collaborators

  • bear_ei