Closed emanjavacas closed 2 months ago
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 <div>
.
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
.— Reply to this email directly, view it on GitHub https://github.com/vanjs-org/van/issues/342#issuecomment-2174025600, 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!