Skip to content

Typescript displays wrong messages. #285

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

Closed
yancaidev opened this issue Jul 7, 2022 · 0 comments
Closed

Typescript displays wrong messages. #285

yancaidev opened this issue Jul 7, 2022 · 0 comments

Comments

@yancaidev
Copy link

yancaidev commented Jul 7, 2022

Expected results

The snippet below is the code of the AssetsScreen.tsx file.

import { Text, View } from 'react-native';
import React, { Component } from 'react';

export default class AssetsScreen extends Component {
  render() {
    return (
      <View>
        <Text>AssetsScreen</Text>
      </View>
    );
  }
}

Expecting typescript does not display the error message "Operator '<' cannot be applied to the types 'View' and 'RegExp'".

But it's strange that some other components don't have the same problem.

Observed results

image
image

Steps to reproduce

  1. npx react-native init rn_wallet --template react-native-template-typescript.
  2. yarn start
  3. yarn android
  4. Create a directory "src" in the root directory of the project.
  5. Create an "AssetsScreen.tsx" and write down the component code.

Environment

  • windows 11
  • node v16.13.1
  • vscode 1.68.1
  • react-native 0.69.1
  • yarn 1.22.17
@yancaidev yancaidev changed the title Typescript displays wrong message. Typescript displays wrong messages. Jul 7, 2022
@yancaidev yancaidev closed this as not planned Won't fix, can't repro, duplicate, stale Sep 9, 2023
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