1.1.0 • Published 2 years ago
@nanshu/monitor v1.1.0
个人博客 blog( 停止维护 ⚠️ )
学习笔记 code-traveling ( codeing 🧑💻 )
个人网站 fe-tutorial ( 施工中 🚧 )
个人 UI @nanshu/ui ( 建设中 👷 )
一些些 npm package( 扩展中 🏗 )
🌟 Features
- HashRoute
- HistoryRouue
- Asset Load Error
- Js Error
- Unhandledrejection
- Fetch
- XMLHttpRequest
- User Event
- React ErrorBoundary
🌟 Preview
🌟 Install
yarn add @nanshu/monitor
🌟 Usage
import { MProvider, init } from '@nanshu/monitor';
// 不传参数则默认全部开启
const instance = init();
ReactDOM.render(
<MProvider instance={instance}>
<React.StrictMode>
<App />
</React.StrictMode>
</MProvider>,
document.getElementById('root')
);
import { ErrorBoundary } from '@nanshu/monitor';
const instance = init();
ReactDOM.render(
<ErrorBoundary>
<React.StrictMode>
<App />
</React.StrictMode>
</ErrorBoundary>,
document.getElementById('root')
);