Skip to content

TypeScript string is not assignable to type string[] #7

@mdt2

Description

@mdt2

Hi there! I'm wondering if there's a TypeScript-friendly solution to pass multiple class names to the className prop. Since className type is string, it throws a TypeScript error TypeScript string is not assignable to type string[] when I pass names using an array, for example:

className={[style.container, style.grid]}

Is there another way I can be doing this? Thank you for your help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions