小编Rag*_*ngh的帖子

错误:无法从`index.js`解析模块`react`:在项目中找不到react

错误:无法reactindex.js以下位置解析模块:在项目中找不到反应。

当我尝试运行我的项目时,它会给我这个捆绑失败的错误。

在此处输入图片说明

这是我的 index.js 文件代码。

/**
 * @format
 */
import React,{Component} from 'react';
import {AppRegistry} from 'react-native';
import {name as appName} from './app.json';
import src from './Screens/Search'
import AppContainer from "./Component/MainNavigation";
class myApp extends Component {
    render(){
        return(
            <AppContainer />
        )
    }

}
AppRegistry.registerComponent(appName, () => myApp);
Run Code Online (Sandbox Code Playgroud)

package.json 文件。

{
  "name": "CharityDating",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint ."
  },
  "dependencies": {
    "@ptomasroos/react-native-multi-slider": …
Run Code Online (Sandbox Code Playgroud)

react-native react-native-android react-native-ios

7
推荐指数
2
解决办法
7748
查看次数

如何在react-native-google-places-autocomplete中设置搜索图像图标?

如何在react-native-google-places-autocomplete中设置搜索图像图标?

我想知道如何在react-native-google-places-autocomplete中设置左侧的搜索图像图标。

我想要在下面的屏幕中输出这样的输出。所以请帮助我。

在此输入图像描述 但我的设计是这样的。

在此输入图像描述

这是 DiscoveryLocation.js 文件的代码。

import React, { Component } from 'react'
    import { Text, View, TouchableOpacity, TextInput, StyleSheet, Image } from 'react-native'
    import { heightPercentageToDP as hp, widthPercentageToDP as wp } from 'react-native-responsive-screen';
    import { RFPercentage, RFValue } from "react-native-responsive-fontsize";
    import MapView, { PROVIDER_GOOGLE, Marker } from 'react-native-maps';
    import { GooglePlacesAutocomplete } from 'react-native-google-places-autocomplete';
    console.disableYellowBox = true;

    export default class DiscoveryLocation extends Component {
        render() {
            return (
                <View style={styles.container}>
                    <View style={styles.vwheader} >
                        <TouchableOpacity
                            onPress={() => { …
Run Code Online (Sandbox Code Playgroud)

google-maps react-native react-native-ios google-places-autocomplete

4
推荐指数
1
解决办法
4275
查看次数