Enabling strict mode surfaces errors like 'Type X is not assignable to type Y', especially when passing objects, generics, or union types between functions and components.
TypeScript uses structural typing, so the shapes must match, not just the names. Read the full error carefully, narrow unions with type guards, and use utility types instead of duplicating shapes.
Step-by-Step Guide
Read the full error message - TypeScript points to the exact mismatched property
Use interface extension instead of duplicating similar type definitions
Narrow union types with type guards: typeof, in, or instanceof checks
Use the 'satisfies' operator to validate object literals without widening their type
Avoid using 'as' to force a type unless you're certain it's safe
Constrain generics properly: function foo<T extends SomeShape>(item: T)
Use utility types like Partial, Pick, and Omit to reshape existing types
Enable strict: true early in a project to catch these issues sooner
Found an issue with this solution?