9494}
9595
9696
97- class ErrorMessageAIO (MPComponent ):
97+ class ErrorMessageAIO (html . Div , MPComponent ):
9898 class ids :
9999 wrapper = lambda aio_id : {
100100 "component" : "ErrorMessageAIO" ,
@@ -205,6 +205,19 @@ def __init__(
205205 if style :
206206 self .notification_style .update (style )
207207
208+ # Define the component's layout, this is originally from `layout()` for MPComponent
209+ # But since this is AIO, which subclassing html.Div
210+ sub_layouts = self ._sub_layouts
211+ super ().__init__ (
212+ [ # Equivalent to `html.Div([...])`
213+ dcc .Store (id = self .ids .visible (self .snake_id ), data = False ),
214+ sub_layouts ["notification_div" ],
215+ sub_layouts ["interval" ],
216+ ],
217+ id = self .ids .wrapper (self .snake_id ),
218+ style = {"display" : "none" },
219+ )
220+
208221 @property
209222 def _sub_layouts (self ):
210223 # Build inner content
@@ -265,6 +278,7 @@ def _sub_layouts(self):
265278
266279 return {"notification_div" : notification_div , "interval" : interval }
267280
281+ """
268282 def layout(self) -> html.Div:
269283 sub_layouts = self._sub_layouts
270284 return html.Div(
@@ -276,6 +290,7 @@ def layout(self) -> html.Div:
276290 id=self.ids.wrapper(self.snake_id),
277291 style={"display": "none"},
278292 )
293+ """
279294
280295 @callback (
281296 Output (ids .wrapper (MATCH ), "style" ),
0 commit comments