我有一个使用react-google-maps的create-react-app。我想要做的是从‘react-google- SearchBox /lib/places/SearchBox’导入地图,但我得到了以下错误:
Module not found: Can't resolve 'react-google-maps/lib/places/SearchBox' in 'D:\ReactApp\demo\src\components'import React from 'react';
import { withScriptjs, withGoogleMap, GoogleMap, Marker } from "react-google-maps"
import SearchBox from 'react-google-maps/lib/places/SearchBox';其他导入工作正常。当我从子目录(即/node_modules/react-google-map/lib/...)导入模块时,似乎出现了问题。
发布于 2020-01-20 20:28:20
尝试使用以下命令:
yarn add react-google-maps-loader --windows
npm install react-google-maps-loader --save和
yarn add react-google-maps-loader --windows
npm install react-google-maps-loader --savehttps://stackoverflow.com/questions/56325427
复制相似问题