Typescript error: TS7053 Element implicitly has an 'any' type

Solution 1:

You have to define what kind of index type the object has. In your case it is a string based index.

const myObj: {[index: string]:any} = {}

Solution 2:

Create TS Map intead.

const myObj = new Map();
myObj.set('propname', "something");

const propname = 'propname'
myObj.get(propname)