How to fix readonly property cannot be assigned to in TypeScript | DevErrors