-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Element not rendering properly #342
Comments
Can you try to replace () => filelist.val.files.map(createListItem) to () => div(filelist.val.files.map(createListItem)) |
hey thanks for chiming in! I did try but it behaves the same somehow. I've put all the code on this repo: https://github.com/emanjavacas/LLM-detect/blob/main/static/main.js |
This line https://github.com/emanjavacas/LLM-detect/blob/5d23dc0828254970ce1858e057a3ea6e97281ed2/static/main.js#L133, needs to be changed to () => div(filelist.val.files.map(createListItem)) as @sirenkovladd suggested, basically, for state-derived DOM nodes, we don't support binding functions that return an array. You need to wrap the array of DOM nodes with a pass-through container element like |
Oh thanks for the quick response.
Yes indeed I managed to solve this! Thanks for your help and feel free to
close the issue ,
Enrique Manjavacas
…On Mon, 17 Jun 2024 at 20:11, Tao Xin ***@***.***> wrote:
This line
https://github.com/emanjavacas/LLM-detect/blob/5d23dc0828254970ce1858e057a3ea6e97281ed2/static/main.js#L133,
needs to be changed to
() => div(filelist.val.files.map(createListItem))
as @sirenkovladd <https://github.com/sirenkovladd> suggested, basically,
for state-derived DOM nodes, we don't support binding functions that return
an array. You need to wrap the array of DOM nodes with a pass-through
container element like <div>.
—
Reply to this email directly, view it on GitHub
<#342 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABPIPI7JU4OOIU5QYNSTIXLZH4RFHAVCNFSM6AAAAABJOOJBOGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNZUGAZDKNRQGA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Hi! First of all thanks for this amazing package, I just started playing around and after a few hours of trying to figure out my issue I am writing to see if you can point me in the right direction.
I am writing an app that lets users upload files and processes them updating the users about the status.
Info about the files is stored in a list (I created the following structure):
When adding an item to this list, I am expecting an update on the front end, the only I get to see is
[object HTMLLIElement]
.I am adding the relevant code down here.
Updating state:
Creating elements for rendering:
This is how I add it to the document:
I've been trying several ways but somehow nothing turns up as expected. Any help appreciated!
The text was updated successfully, but these errors were encountered: