gold3n
gold3n
DDeno
Created by gold3n on 12/28/2024 in #help
Is it possible to import styles and use them in a Typescript React component when using Vite+Deno?
deno check always complains when I try to do things like import { styles } from './MyComponent.module.css' and then use them like className={styles.myHeader}. When I do import * as styles from './MainHeader.module.css' it stops complaining about the import but then complains when I use properties like className={styles.myHeader} and says that myHeader doesn't belong there. This is for CSS modules but I guess I'd have the same issue without modules, as long as I try to access properties in component. The app can work thanks to vite but not without deno linter / deno check issues. I've tried to add things like this but it didn't help in the end.
declare module "*.module.css" {
export const styles: {
readonly [key: string]: string
}
}
declare module "*.module.css" {
export const styles: {
readonly [key: string]: string
}
}
Is there officially no way to make this work without linter issues?
1 replies
DDeno
Created by gold3n on 12/19/2024 in #help
Cannot find module 'npm:react-router-dom' or its corresponding type declarations.
This is the error message the Typescript LSP gives me when I use the line import { Outlet } from "npm:react-router-dom". What is the proper way to get rid of it?
5 replies