Skip to content

Add support to CSS modules #21324

@sheltondong

Description

@sheltondong

Typescript can not recognize CSS file, so it self can't support CSS modules, when I type this:

import React from 'react';
import styles from './style.css';

const Button = () => {
     return (
         <button className={styles.myButtonClass}>click me</button>
     )
}

It will cause:

Cannot find module './style.css'.

Could you please add support for CSS modules?

Metadata

Metadata

Assignees

No one assigned

    Labels

    QuestionAn issue which isn't directly actionable in code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions