Skip to content

Commit

Permalink
feat(SimpleChildComponent): Add warning text
Browse files Browse the repository at this point in the history
if user attempts to use componenet without corresponding library
  • Loading branch information
idolize committed May 15, 2015
1 parent 9b3cbeb commit 9652e0c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/internals/SimpleChildComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ var SimpleChildComponent = (function (_EventComponent) {
} else {
var googleMapsClassName = this.constructor._GoogleMapsClassName;
if (!_objectPath2["default"].has(googleMapsApi, googleMapsClassName)) {
console.warn("Warning: This react-google-maps component can't find the corresponding Google Maps API class '" + googleMapsClassName + "'. " + "You may have to include additional Google Maps libraries in your javascript src URL. " + "See: https://developers.google.com/maps/documentation/javascript/libraries");
return;
}
var GoogleMapsClass = _objectPath2["default"].get(googleMapsApi, googleMapsClassName);
Expand Down
5 changes: 5 additions & 0 deletions src/internals/SimpleChildComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ class SimpleChildComponent extends EventComponent {
} else {
const googleMapsClassName = this.constructor._GoogleMapsClassName;
if (!objectPath.has(googleMapsApi, googleMapsClassName)) {
console.warn(
`Warning: This react-google-maps component can't find the corresponding Google Maps API class '${googleMapsClassName}'. ` +
`You may have to include additional Google Maps libraries in your javascript src URL. ` +
`See: https://developers.google.com/maps/documentation/javascript/libraries`
);
return;
}
const GoogleMapsClass = objectPath.get(googleMapsApi, googleMapsClassName);
Expand Down

0 comments on commit 9652e0c

Please sign in to comment.