Attach a default onError handler, logging to console.error (#706)

This commit is contained in:
Karl-Aksel Puulmann 2019-01-27 22:10:52 +02:00 committed by Xiaoji Chen
parent cc4c3cf94b
commit c33dc49e40

View File

@ -25,6 +25,12 @@ import {document} from '../utils/globals';
function noop() {}
function defaultOnError(event?: { error: any }) {
if (event) {
console.error(event.error); // eslint-disable-line
}
}
const propTypes = {
// Creation parameters
container: PropTypes.object, /** The container to have the map. */
@ -73,7 +79,7 @@ const defaultProps = {
visible: true,
onLoad: noop,
onError: noop,
onError: defaultOnError,
width: 0,
height: 0,