udibo / react-app

A React Framework for Deno that makes it easy to create highly interactive apps that have server side rendering with file based routing for both your UI and API.
https://udibo-react-app.deno.dev/
MIT License
14 stars 2 forks source link

Remove default ErrorFallback and add boundary override #56

Closed KyleJune closed 1 year ago

KyleJune commented 1 year ago

By default, if an ErrorFallback wasn't specified in the main route for your routes directory, it would add an error boundary with the DefaultErrorFallback as its ErrorFallback. This gets rid of that so that it's possible to define your own error boundary within your component without having to specify a boundary.

I believe it will be common for people to want to add their own AppErrorBoundary within the component for a route. To make this easier, I added the ability to export a boundary string from the file instead of an ErrorFallback component. If you export a boundary string, the server will use that for it's errorBoundary middleware, making it easier to signal that it should use the AppErrorBoundary within your route's component.