vue-typescript icon indicating copy to clipboard operation
vue-typescript copied to clipboard

tsx

Open davidmoshal opened this issue 8 years ago • 0 comments

Hi, wondering how to get TSX to work?

I followed general tsx advise from: https://basarat.gitbooks.io/typescript/content/docs/jsx/tsx.html

  • Use files with the extension .tsx (instead of .ts).
  • Use "jsx" : "react" in your tsconfig.json's compilerOptions.
  • Install the definitions for JSX and React into your project : (typings install dt~react --save && typings install dt~react-dom --save).
  • Import react into your .tsx files (import * as React from "react").

However, I get this error:

Types of property 'template' are incompatible. Type 'Element' is not assignable to type 'string'

davidmoshal avatar Aug 22 '16 21:08 davidmoshal