S
SolidJS3y ago
reed

confused on rendering issue

const [selectedFile, setSelectedFile] = createSignal<File | null>(null)

return (
<div>
<input type="file" onChange={handleFileChange} />
{selectedFile() && <p class="text-red-500">File selected: {selectedFile()!.name}</p>}
</div>
)
const [selectedFile, setSelectedFile] = createSignal<File | null>(null)

return (
<div>
<input type="file" onChange={handleFileChange} />
{selectedFile() && <p class="text-red-500">File selected: {selectedFile()!.name}</p>}
</div>
)
the <p> element is not rendering. i inspected the element in dev tools and it doesn't exist, nor are the styles being applied, or anything.
3 Replies
lxsmnsyc
lxsmnsyc3y ago
where's the part where setSelectedFile is being used?
reed
reedOP3y ago
fixed
Lo | Building Dromo
what was the issue? because I'm currently running into rendering issues with the input file

Did you find this page helpful?