Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

With Typescript,How can I use props 'styleName' on tag <div> #269

Open
lcnxx opened this issue Aug 22, 2019 · 4 comments
Open

With Typescript,How can I use props 'styleName' on tag <div> #269

lcnxx opened this issue Aug 22, 2019 · 4 comments
Labels

Comments

@lcnxx
Copy link

lcnxx commented Aug 22, 2019

No description provided.

@gustavocd
Copy link

Just add the types for react-css-modules:

npm install --save @types/react-css-modules

Check the package here

@gajus gajus added the question label Aug 26, 2019
@EmiyaYang
Copy link

EmiyaYang commented May 9, 2020

The react-css-modules is desperated now and it doesn't work for me.

@EmiyaYang
Copy link

This works for me.

// global.d.ts
import 'react';

declare module 'react' {
  interface Attributes {
    styleName?: string;
  }
}

@max-mykhailenko
Copy link

@EmiyaYang your solution doesn't work with
typescript 4.3.5 and react 17.0.2
Got Property 'styleName' does not exist on type 'DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>'

Maybe you have some thoughts how to fix that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants