First of all thanks for the greatly structured library.
I was trying to find a way to use custom components (like React.createElement):
classItem:
def__init__(self, attrs, *args, **kwargs):
self.attrs=attrsdefrender(self):
check='[x]'ifself.attrs['done'] else'[ ]'returnli([check, ' ', self.attrs['title']])
defList():
returndiv(
ul([
h(Item, title='Todo 1', done=True),
h(Item, title='Todo 2', done=False),
])
)
Which renders:
<div><ul><li>[x] Todo 1</li><li>[ ] Todo 2</li></ul></div>
Seems like I need to alter the h function to do so. Am I correct?
Thanks in advance!
First of all thanks for the greatly structured library.
I was trying to find a way to use custom components (like React.createElement):
Which renders:
Seems like I need to alter the h function to do so. Am I correct?
Thanks in advance!