Skip to content

React TSX doesn't understand function param types #3089

@jamesgpearce

Description

@jamesgpearce

Information

  • Language: React TSX (vs Typescript)
  • Plugins: as in Test Drive

Description

Consider this code:

function log(msg: string): void {
  console.log(msg);
}

When using the Typescript language the string parameter type is identified and highlighted:

image

When using the React TSX language, the string parameter is not identified and just treated like text:

image

Since TSX is supposed to be an extension to Typescript, the results should be the same.

Link to broken react TSX highlighting: https://prismjs.com/test.html#language=tsx&text=%2F%2F%20react%20tsx%0Afunction%20log(msg%3A%20string)%3A%20void%20%7B%0A%20%20console.log(msg)%3B%0A%7D%0A

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions