File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 140140 google : null ,
141141 options : options
142142 } ;
143+
144+ _this . mapRef = _react2 . default . createRef ( ) ;
143145 return _this ;
144146 }
145147
215217 'div' ,
216218 null ,
217219 _react2 . default . createElement ( WrappedComponent , props ) ,
218- _react2 . default . createElement ( 'div' , { ref : 'map' } )
220+ _react2 . default . createElement ( 'div' , { ref : this . mapRef } )
219221 ) ;
220222 }
221223 } ] ) ;
Original file line number Diff line number Diff line change 156156 lng : _this . props . initialCenter . lng
157157 }
158158 } ;
159+
160+ _this . mapRef = _react2 . default . createRef ( ) ;
159161 return _this ;
160162 }
161163
233235
234236 var maps = google . maps ;
235237
236- var mapRef = this . refs . map ;
238+ var mapRef = this . mapRef . current ;
237239 var node = _reactDom2 . default . findDOMNode ( mapRef ) ;
238240 var curr = this . state . currentLocation ;
239241 var center = new maps . LatLng ( curr . lat , curr . lng ) ;
373375 { style : containerStyles , className : this . props . className } ,
374376 _react2 . default . createElement (
375377 'div' ,
376- { style : style , ref : ( element ) => ( this . ref . map = element ) } ,
378+ { style : style , ref : this . mapRef } ,
377379 'Loading map...'
378380 ) ,
379381 this . renderChildren ( )
You can’t perform that action at this time.
0 commit comments