2

I have a create-react-app which uses react-google-maps. What I want to do is to import SearchBox from 'react-google-maps/lib/places/SearchBox' but I'm getting the following error:

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';

Other imports work normally. It looks like the problem occurs when I import a module from subdirectory i.e. /node_modules/react-google-maps/lib/....

Nazar
  • 21
  • 2
  • 5

1 Answers1

-1

try to use this:

yarn add react-google-maps-loader --windows
npm install react-google-maps-loader --save

And

yarn add react-google-maps-loader --windows
npm install react-google-maps-loader --save
JustCarty
  • 3,839
  • 5
  • 31
  • 51
Zakaria
  • 27
  • 1
  • 1