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
In the case below where we are missing import { Image } from 'react-native';
import { Image } from 'react-native';
import { render } from '@testing-library/react-native'; describe('test lsp', () => { render(<Image />); });
the available code action from the tsserver are
tsserver
because we are using react-18, importing react is unnecessary.
After adding
import React from' react';
then the code actions work
the Add import from "react-native" should show up on the first try.
Add import from "react-native"
typescript-language-server --version 2.1.0
The text was updated successfully, but these errors were encountered:
Are you able to provide a minimal project that reproduces this issue?
Sorry, something went wrong.
@rchl, I created a quick repo to reproduce. https://github.com/davidhu2000/ts-lsp-import-bug
I did someadditional tests, and it appears that the following option works
{ "compilerOptions": { "jsx": "react-jsx",
however, jsx: 'react-native' or jsx: react does not work. does this mean this is a typescript issue?
jsx: 'react-native'
jsx: react
Possibly related? microsoft/TypeScript#41762
I suppose so. If this also works the same in VSCode then most definitively something that Typescript might need to handle.
Yeah. Also happening in VS Code, l I'll open an issue with typescript
No branches or pull requests
In the case below where we are missing
import { Image } from 'react-native';
the available code action from the
tsserver
arebecause we are using react-18, importing react is unnecessary.
After adding
then the code actions work
the
Add import from "react-native"
should show up on the first try.The text was updated successfully, but these errors were encountered: