S
SolidJS2y 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
lxsmnsyc2y ago
where's the part where setSelectedFile is being used?
reed
reedOP2y ago
fixed
Carlo Nyte
Carlo Nyte14mo ago
what was the issue? because I'm currently running into rendering issues with the input file

Did you find this page helpful?