question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not compatible with latest Flow (React)

See original GitHub issue

This is a:

  • Bug Report
  • Feature Request
  • Question
  • Other

Which concerns:

  • flow-runtime
  • babel-plugin-flow-runtime
  • flow-runtime-validators
  • flow-runtime-mobx
  • flow-config-parser
  • The documentation website

What is the current behaviour?

Flow >=0.53.0 modified how React classes are defined. Instead of 3x type arguments (DefaultProps, Props, State), there are only 2x type arguments (Props, State).

As-is, flow-runtime incorrectly maps Props => DefaultProps and State => Props, resulting in incorrect warnings/errors.

https://flow.org/en/docs/react/components/ https://medium.com/flow-type/even-better-support-for-react-in-flow-25b0a3485627

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:11
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
amilajackcommented, Nov 3, 2017

Testing a fix for this here: https://github.com/amilajack/babel-plugin-flow-runtime Installation:

# npm
npm install --save-dev github:amilajack/babel-plugin-flow-runtime
# yarn
yarn add --dev github:amilajack/babel-plugin-flow-runtime
0reactions
cbazureaucommented, Nov 9, 2017

Hello, thanks @amilajack, i’ve applied your patch on a flow-runtime fork for better reading : https://github.com/cbazureau/flow-runtime/commit/8d8fd5b4a34ad0b1b7782fd11fd5d08bd933a015

Linked issue : https://github.com/facebook/flow/issues/5029

Read more comments on GitHub >

github_iconTop Results From Across the Web

[flow] statics of React.Component [1] is incompatible ... - GitHub
I did use React.ComponentType<any> . Check the first link in my post. Flow complains at React.ComponentType but not at Class<React.
Read more >
Troubleshooting Guide - React Flow
This guide contains warnings and errors that can occur when using React Flow. We are also adding common questions and pitfalls that we...
Read more >
Why does Flow report my React component as being ...
Cannot instantiate React.Element because in type argument ElementType: • Either class UploaderInput [1] is incompatible with string [2].
Read more >
Static Type Checking - React
Static type checkers like Flow and TypeScript identify certain types of problems before you even run your code. They can also improve developer...
Read more >
Supported Browsers and Features | Create React App
By default, the generated project supports all modern browsers. Support for Internet Explorer 9, 10, and 11 requires polyfills. For a set of ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found