Skip to content

Interface types aren't compatible in 2.3.2 #294

Description

@bytemain

I meet a typing issue in 2.3.2:

it worked on 2.3.1.

import classNames from 'classnames';

export interface ValidateType {
  error?: boolean;
}

const result: ValidateType | undefined = {
  error: true
} as ValidateType;

const data = classNames(result);
console.log(`🚀 ~ file: index.ts ~ line 10 ~ data`, data);

CleanShot 2022-11-11 at 19 58 56@2x

[{
	"resource": "/private/tmp/artin-QVhj2J/index.ts",
	"owner": "typescript",
	"code": "2345",
	"severity": 8,
	"message": "Argument of type '[ValidateType]' is not assignable to parameter of type 'ArgumentArray'.\n  Type 'ValidateType' is not assignable to type 'Argument'.\n    Type 'ValidateType' is not assignable to type 'Mapping'.\n      Index signature for type 'string' is missing in type 'ValidateType'.",
	"source": "ts",
	"startLineNumber": 11,
	"startColumn": 25,
	"endLineNumber": 11,
	"endColumn": 31
}]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions