SolidJSS
SolidJSโ€ข3y agoโ€ข
3 replies
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>
    )

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.
Was this page helpful?