Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash with Flow component syntax #944

Open
neutraali opened this issue Sep 20, 2024 · 4 comments
Open

Crash with Flow component syntax #944

neutraali opened this issue Sep 20, 2024 · 4 comments

Comments

@neutraali
Copy link

neutraali commented Sep 20, 2024

Docs: https://flow.org/en/docs/react/component-syntax/

Code

component Example( text: string = 'Hello World' ) {
    return <div>{text}</div>;
}

Expected

[
  {
    "description": "",
    "displayName": "Example",
    "methods": [],
    "props": {
      "text": {
        "required": false,
        "flowType": {
          "text": "string"
        },
        "description": "",
        "defaultValue": {
          "value": "'Hello World'",
          "computed": false
        }
      }
    }
  }
]

Actual

SyntaxError: playground.tsx: Missing semicolon. (1:9)

> 1 | component Example(
    |          ^
  2 | 	text: string = 'Hello World'
  3 | ) {
  4 | 	return <div>{text}</div>
@danez
Copy link
Collaborator

danez commented Sep 21, 2024

Scheint noch nicht unterstützt zu sein in Babel. Ich werde mal Recherchieren.

@mikaeltoivio
Copy link

I also need this fixed

@jjylha
Copy link

jjylha commented Oct 3, 2024

Me too

@danez
Copy link
Collaborator

danez commented Oct 19, 2024

Babel has deprecated its official support for flowjs. We need to switch to hermes-parser for flow in order to support this. This will be a bigger undertaking and take a while.

@github-staff github-staff deleted a comment from SAMBILI Oct 28, 2024
@github-staff github-staff deleted a comment from SAMBILI Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants