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

Did you find this page helpful?