Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

231
Visualizações
"Expected an arrow function after this type parameter declaration" error

I got this error while running yarn start:

$ yarn start
yarn run v1.22.17
$ run-s build exec
$ babel src/ -d lib/
SyntaxError: .../src/App.js: Expected an arrow function after this type parameter declaration. (8:9)

   6 |
   7 | export default function App(): React$MixedElement {
>  8 |   return <p>Hello, React!</p>;
     |          ^
   9 | }
  10 |

Below are the configs:

package.json

"scripts": {
    "flow": "flow",
    "start": "run-s build exec",
    "exec": "node lib/index.js",
    "build": "babel src/ -d lib/",
},

babel.config.json:

{
  "presets": ["@babel/preset-flow"],
  "plugins": ["babel-plugin-transform-flow-enums"],
  "targets": {
    "esmodules": true
  }
}

App.js:

// @flow

import "./App.css";

import React from "react";

export default function App(): React$MixedElement {
  return <p>Hello, React!</p>;
}

What the issue with my configs and react file?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

It seems to be a typo on React.MixedElement, replace the $ by a .:

export default function App(): React.MixedElement {...}
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda