We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
DevTools tells Babel to parse the source code using "jsx" and "typescript" plug-ins:
react/packages/react-devtools-extensions/src/parseHookNames.js
Lines 446 to 462 in ed6c091
This will work for some simple usages of Flow, but syntax may diverge and cause the parsing to fail.
Let's scan the source code for a @flow pragma and pass "flow" instead of "typescript" if one is found.
@flow
We should also add tests for both Flow and TypeScript to the test component pool: https://github.com/facebook/react/tree/main/packages/react-devtools-extensions/src/__tests__/__source__
The text was updated successfully, but these errors were encountered:
I think something as basic as this should work:
function getBabelPluginsList(originalSourceCode: string): Array<string> { const plugin = originalSourceCode.indexOf('@flow') > 0 ? 'flow' : 'typescript'; return ['jsx', plugin]; }
Sorry, something went wrong.
bvaughn
Successfully merging a pull request may close this issue.
DevTools tells Babel to parse the source code using "jsx" and "typescript" plug-ins:
react/packages/react-devtools-extensions/src/parseHookNames.js
Lines 446 to 462 in ed6c091
This will work for some simple usages of Flow, but syntax may diverge and cause the parsing to fail.
Let's scan the source code for a
@flow
pragma and pass "flow" instead of "typescript" if one is found.We should also add tests for both Flow and TypeScript to the test component pool:
https://github.com/facebook/react/tree/main/packages/react-devtools-extensions/src/__tests__/__source__
The text was updated successfully, but these errors were encountered: