ReactJS and Typescript : refers to a value, but is being used as a type here (TS2749)

Solution 1:

Make sure you're on a .tsx file and not a .ts file

Solution 2:

change .ts file to .tsx

in my case it works