#Unsafe assignment of using a type in useState

2 messages · Page 1 of 1 (latest)

chilly blaze
#

Never seen this before. I added quite a bit of ESLint rules of other repositories, everything works fine, a lot of good comments. But now I get this weird array destructure error on using a type with useState:

The type in question:

export type Sheet = {
    bestTotalCostPerOperation: number,
    worstTotalCostPerOperation: number,
}

The small bit of code for state:

const [ sheet, setSheet ] = useState<Sheet>();

Changing it's type fixes the issue, but what could possibly cause this?

#

It seemed like restarting for the second time fixed it. Think something was just lagging behind