error message:"
"The element is implicitly of type "any" because an expression of type "string" cannot be used for indexing of type "IColorPokemonObj". No index signature found in type "IColorPokemonObj" with parameter of type "string" .ts (7053)"
<SubPopupPokemonImg styleBackground={{background: colorPokemonObj?.[type1]}}>
export const colorPokemonObj: IColorPokemonObj = {
fire : '#D93E30',
grass : '#7AC74C',
electric : '#f2cb07',
water:'#35BAFF',
ground:'#E2BF65',
rock:'#B6A136',
fairy: '#D685AD',
poison: '#64D368',
bug: '#A6B91A',
dragon:'#6F35FC',
psychic:'#F95587',
flying:'#A98FF3' ,
fighting:'#C22E28' ,
normal:'#A8A77A' ,
ice:'#96D9D6' ,
ghost:'#735797' ,
dark: '#705746' ,
unknown: '#B7B7CE'
}
export interface IColorPokemonObj {
fire: string;
grass: string;
electric: string;
water: string;
ground: string;
rock: string;
fairy: string;
poison: string;
bug: string;
dragon: string;
psychic: string;
flying: string;
fighting: string;
'normal': string ,
'ice': string ,
'ghost':string ,
'dark': string,
'unknown': string
}
if you pass the call signature, then immediately yields the type any and error