mirror of
https://github.com/django-components/django-components.git
synced 2025-11-13 20:25:20 +00:00
refactor: make it optional having to specify parent class of Args, Kwargs, Slots, etc (#1466)
This commit is contained in:
parent
0aeb96fa40
commit
c37628dea0
34 changed files with 661 additions and 299 deletions
|
|
@ -289,14 +289,14 @@ To implement this, we render the fallback slot in [`on_render()`](../../../refer
|
|||
and return it if an error occured:
|
||||
|
||||
```djc_py
|
||||
from typing import NamedTuple, Optional
|
||||
from typing import Optional
|
||||
|
||||
from django.template import Context, Template
|
||||
from django.utils.safestring import mark_safe
|
||||
from django_components import Component, OnRenderGenerator, SlotInput, types
|
||||
|
||||
class ErrorFallback(Component):
|
||||
class Slots(NamedTuple):
|
||||
class Slots:
|
||||
default: Optional[SlotInput] = None
|
||||
fallback: Optional[SlotInput] = None
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue