<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.
5 Replies
Can you post your
tsconfig.json
?
You could add a type annotation so it's createSignal<boolean>(false)
, but you shouldn't have to.@hypersoar This is my tsconfig.json
Hmm, I was hoping to see something wrong there, but nothing sticks out :/
The same code works fine in my setup.
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
I think that's a bug in IntelliJ's engine, then.