Skip to content

tsx #15

@davidmoshal

Description

@davidmoshal

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 dtreact --save && typings install dtreact-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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions