MCPcopy Create free account
hub / github.com/emwalker/digraph / withErrorBoundary

Function withErrorBoundary

client/src/components/withErrorBoundary.tsx:10–23  ·  view source on GitHub ↗
(Wrapped: ComponentType<any>)

Source from the content-addressed store, hash-verified

8}
9
10function withErrorBoundary<V>(Wrapped: ComponentType<any>) {
11 return (routeProps: RouteRenderArgs) => {
12 const { props, match } = routeProps
13 const renderProps = props as ViewRenderProps<V>
14 const view = renderProps?.view
15 return (
16 view && (
17 <ErrorBoundary>
18 <Wrapped view={view} match={match} />
19 </ErrorBoundary>
20 )
21 )
22 }
23}
24
25export default withErrorBoundary

Callers 1

createRouteConfigFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected