I am currently using Prettier version 1.17.1 and TypeScript 3.4.5 in combination with create-react-app.
Every time I attempt to utilize the x as T
syntax in TypeScript for type casting, I encounter the following error:
src/Form.tsx
[error] src/Form.tsx: SyntaxError: Unexpected identifier (82:57)
[error] 80 | value={data.position}
[error] 81 | onChange={e => {
[error] > 82 | const nextPosition = e.target.value as Position
Although I have also experimented with an alternative syntax <T> x
, it causes a failure during Typescript compilation due to the JSX format.