A comprehensive bug tracking tool tailored for React, ensuring that no UI bug goes unnoticed!
- Install Dependency
npm install react-bug-tracker
import BugReporter from "react-bug-tracker";
// pass server endpoint where you need to store the bug report
const report = new BugReporter("https://your-api-endpoint.com/report");
// Set up the error listener when the script loads
const cleanupErrorListener = bugReporter.setupErrorListener();
const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(
<React.StrictMode>
<App />
</React.StrictMode>
);
// Clean up the error listener when the component unmounts
if (cleanupErrorListener) {
window.addEventListener("beforeunload", cleanupErrorListener);
}
Shubham Singh |