Let’s say I have a variable which takes the value of a class name.
If I say:
import * as css from '../styles/hazardhunt.m.css';
@theme(css)
export class HazardHunt extends HazardBase {
private changes:{[index:string]:boolean}={};
protected onClick=(evt:MouseEvent,item:string)=>{
evt && evt.preventDefault();
if((item in css) && !(css[item] in this.changes)) {
...
}
}
}
It works, but it complains:
TS7017: Element implicitly has an ‘any’ type because type ‘typeof “[…]/src/styles/hazardhunt.m.css”’ has no index signature
What should I be doing instead?