jadjoubran / codetogo.io

🚀 JavaScript code to go - Find updated snippets for common JavaScript use cases
https://codetogo.io
MIT License
233 stars 30 forks source link

Use Case Suggestion: How to catch error in React #287

Open Rajdeepc opened 2 years ago

Rajdeepc commented 2 years ago
import React, {ErrorBoundary} from "react";

function App() {
  return (
    <ErrorBoundary>
      <h1>Example to show how to use ErrorBoundary in React</h1>
    </ErrorBoundary>
  );
}