dsherret / ts-nameof

nameof in TypeScript
MIT License
492 stars 23 forks source link

How do I use with react js? #118

Open MassMessage opened 3 years ago

MassMessage commented 3 years ago

I did install and declared it as global function, like below. However, when I went to use it, I get an undefined symbol. What am I missing? do I still need to import it beside making it global? I'm also new to react js.

installed with npm install ts-nameof @types/ts-nameof --save-dev and marked as global with npm install @types/ts-nameof --save-dev

UPDATE: it seems I do have to use ttypescript? does this mess up with tsconfig.json somewhat?

ericaskari commented 3 years ago

if you are willing to use nx or are using nx for your project. I found an easy way to do all this: https://github.com/nrwl/nx/issues/4985