<Show when={}> typescript error question.

I'm encountering a type error while working with the following code: const [loggedIn, setLoggedIn] = createSignal(false); In the return section of my component, I'm using the following code: <Show when={loggedIn()}>loading</Show> However, within the when attribute, I'm facing the following type error: "type boolean is not assignable to type false | undefined | null | T." Can someone explain why this is happening? Your assistance is greatly appreciated.
No description
5 Replies
Nathan
Nathan10mo ago
Can you post your tsconfig.json? You could add a type annotation so it's createSignal<boolean>(false), but you shouldn't have to.
Alexis Graff
Alexis Graff10mo ago
@hypersoar This is my tsconfig.json
No description
Nathan
Nathan10mo ago
Hmm, I was hoping to see something wrong there, but nothing sticks out :/ The same code works fine in my setup.
Alexis Graff
Alexis Graff10mo ago
If i create a totally new project with npm init solid@latest, and i only put that code, it gives me the same error. But.. this only happens with IDEs from INTELLIJ. Visual Studio Code dont give me that type error
Nathan
Nathan10mo ago
I think that's a bug in IntelliJ's engine, then.
Want results from more Discord servers?
Add your server
More Posts