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

flow.js: Cannot resolve name React #175

Open
belka-ew opened this issue Mar 4, 2019 · 0 comments
Open

flow.js: Cannot resolve name React #175

belka-ew opened this issue Mar 4, 2019 · 0 comments

Comments

@belka-ew
Copy link

belka-ew commented Mar 4, 2019

I'm using Flow with Vue and if I have a jsx template, I get an error.

Here is the code:

// @flow

export default {
  render (h: any) {
    return <section />
  }
}

The error is:

5:12 error Cannot resolve name React flowtype-errors/show-errors

I can fix it if by putting // @jsx h on the top of the file - but this solution is not ideal.

I did some research and @babel/plugin-transform-react-jsx supports pragmas in the babel.config.js like this:

{
  "plugins": [
    ["@babel/plugin-transform-react-jsx", {
      "pragma": "h"
    }]
  ]
}

And TypeScript seems to support similar pragmas in the .tsconfig.

Any way to fix it in Vue?

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

1 participant