错误批次
npm - https://www.npmjs.com/package/@evo/errcatch(英语:
QQ 错误边界 API - https://reactjs.org/docs/error-boundaries.html 互联网档案馆的存檔,存档日期2013-12-22。 。 。 .
Фичи:
- {\fn黑体\fs22\bord1\shad0\3aHBE\4aH00\fscx67\fscy66\2cHFFFFFF\3cH808080}你说什么? {\fn黑体\fs20\shad2\2aH82\3aH20\4aH33\fscx95\3cH592001\be1}你觉得呢.
- ============================================================================================= ========================================================================================================================================================= ( (单单.
- {\fn黑体\fs20\shad2\2aH82\3aH20\4aH33\fscx95\3cH592001\be1}你觉得呢.
Установка
npm i @evo/errcatch
Пример:
import { ErrCatch, withErrCatch } from '@evo/errcatch'
const Component = () => (
<div>
<Component1/>
<ErrCatch>
<Component1/>
</ErrCatch>
</div>
);
// or HOC
const Component = withErrCatch(() => (
<div>
<Component1/>
</div>
));
(gotcha,logevo e.t.c) (中文(简体) )
import { setErrCatchLog } from '@evo/errcatch';
import * as gotcha from '@evo/gotcha-log';
setErrCatchLog((msg, error, info) => {
console.error(msg, error, info);
gotcha.error(msg, { message: error.message, stack: error.stack });
});
自定义出错 QQ
import { ErrCatch } from '@evo/errcatch'
const ErrorComponent = () => <div>Error</div>
const Component = () => (
<div>
<Component1/>
<ErrCatch errorComponent={<ErrorComponent/>}>
<Component1/>
</ErrCatch>
</div>
);