I have the following state logic the issue is that for some reason I am getting a union type string and a number on the Object Key but it has to show only strings.
// State
const inicialState: {
[key: string]: string;
type: 'a' |'b' | 'c' | 'd' | 'e' | 'f' | 'g'
} = {
names: '',
data: '',
type: 'a',
};
const [selected, setSelected] = useState < typeof inicialState > (inicialState);
type ObjectKey = keyof typeof selected;
// type ObjectKey = string | number ??