React native 反应本机错误:应为字符串或类/函数";:视差显微镜

React native 反应本机错误:应为字符串或类/函数";:视差显微镜,react-native,React Native,你好,我被这个视差视图卡住了。我从这里得到了基本代码。我不知道为什么,但我得到了这个错误。 这是我的密码 import React, { Component } from 'react'; import { View, Text, Dimensions } from 'react-native'; import ParallaxScrollView from 'react-native-parallax-scrollview'; const SCREEN_HEIGHT = Dimension

你好,我被这个视差视图卡住了。我从这里得到了基本代码。我不知道为什么,但我得到了这个错误。 这是我的密码

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

import ParallaxScrollView from 'react-native-parallax-scrollview';

const SCREEN_HEIGHT = Dimensions.get('window').height;

export default class Aboutme extends Component {
  constructor(props) {
    super(props);
    this.state = {
    };
  }

  render() {
    return (
        <ParallaxScrollView
        windowHeight={SCREEN_HEIGHT * 0.4}
        backgroundSource='http://i.imgur.com/UyjQBkJ.png'
        navBarTitle='John Oliver'
        userName='John Oliver'
        userTitle='Comedian'
        userImage='http://i.imgur.com/RQ1iLOs.jpg'
        leftIcon={{name: 'rocket', color: 'rgba(131, 175, 41, 1)', size: 30, type: 'font-awesome'}}
        rightIcon={{name: 'user', color: 'rgba(193, 193, 193, 1)', size: 30, type: 'font-awesome'}}
      />
    );
  }
}
错误是

`Could not find a declaration file for module 'react-native-parallax-scrollview'. 'd:/Deepthi/REACTNATIVEWORKSPACETWO/DesignOne/node_modules/react-native-parallax-scrollview/src/ParallaxScrollView.js' implicitly has an 'any' type.Try `npm install @types/react-native-parallax-scrollview` if it exists or add a new declaration (.d.ts) file containing `declare module 'react-native-parallax-scrollview';``
所以我安装了

npmi@types/react原生视差滚动视图

又犯了新的错误

@types/react本机视差-scrollview@latest'不在npm注册表中。


请帮助我

代码正常,您是否安装了包(
npm i
)并在添加包之后重新启动metro bundler(节点进程)?

尝试将此元素添加到
主容器元素中。是否!!无法删除leftIcon和rightIcon进行测试,因为我认为您必须安装FontAwesome插件,然后将其导入文件中。或者只需在leftIcon和rightIcon中添加任何静态图像对象,然后运行project@KirankumarDafda我把所有的东西都拿走了,但都没用。查看编辑一次
`Could not find a declaration file for module 'react-native-parallax-scrollview'. 'd:/Deepthi/REACTNATIVEWORKSPACETWO/DesignOne/node_modules/react-native-parallax-scrollview/src/ParallaxScrollView.js' implicitly has an 'any' type.Try `npm install @types/react-native-parallax-scrollview` if it exists or add a new declaration (.d.ts) file containing `declare module 'react-native-parallax-scrollview';``