|
@@ -132,14 +132,17 @@ def default_overlay_component() -> Component:
|
|
|
)
|
|
|
|
|
|
|
|
|
-def default_error_boundary() -> Component:
|
|
|
+def default_error_boundary(*children: Component) -> Component:
|
|
|
"""Default error_boundary attribute for App.
|
|
|
|
|
|
+ Args:
|
|
|
+ *children: The children to render in the error boundary.
|
|
|
+
|
|
|
Returns:
|
|
|
The default error_boundary, which is an ErrorBoundary.
|
|
|
|
|
|
"""
|
|
|
- return ErrorBoundary.create()
|
|
|
+ return ErrorBoundary.create(*children)
|
|
|
|
|
|
|
|
|
class OverlayFragment(Fragment):
|
|
@@ -184,9 +187,7 @@ class App(MiddlewareMixin, LifespanMixin, Base):
|
|
|
)
|
|
|
|
|
|
# Error boundary component to wrap the app with.
|
|
|
- error_boundary: Optional[Union[Component, ComponentCallable]] = (
|
|
|
- default_error_boundary
|
|
|
- )
|
|
|
+ error_boundary: Optional[ComponentCallable] = default_error_boundary
|
|
|
|
|
|
# Components to add to the head of every page.
|
|
|
head_components: List[Component] = []
|
|
@@ -751,7 +752,7 @@ class App(MiddlewareMixin, LifespanMixin, Base):
|
|
|
if self.error_boundary is None:
|
|
|
return component
|
|
|
|
|
|
- component = ErrorBoundary.create(*component.children)
|
|
|
+ component = self.error_boundary(*component.children)
|
|
|
|
|
|
return component
|
|
|
|