Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Property assignment expected. This expression is not callable. Type {} has no call signatures. (how to solve this?)

I wanted to update a badge count in a chat room using cloud function trigger which is a nested map.
I’m updating badges in the frontend without any issue but I want the create a cloud function for this to reduce frontend workloads.
but when I tried to pass a dynamic variable as field/key, the compiler is not happy and it’s giving me an error.

enter image description here

the expected output should be like this

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

enter image description here

Backtick doesn’t work so I tried to change the backtick to double quote to be able to compile, but this was the output which is not what i want.

enter image description here

anyone knows how to make this work? please help.

>Solution :

its syntax issue, missing [ & ].
it should be { [`badgeCount.${receveid}`]: fire.....

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading