When feeling like you want to solve a type error with forceful casting, consider using one of TypeScript’s utility types instead.
And please never use this pattern – object as unknown as SomeType
Casting like this takes away TypeScripts power because you are now telling it what to believe rather than the tooling basing that belief on logic, inference etc.
In general I try to avoid casting altogether but sometimes it cannot be avoided. Another thing to remember – if you do want to use a cast…please only cast just in time. What does this mean? Well when we cast it should be truthful vs context, for example something like renderRightColumn(column as rightColumn) – this makes sense and if our param types are wired up correctly otherwise then TS should be happy with this.