mirror of
https://github.com/visgl/react-map-gl.git
synced 2026-01-25 16:02:50 +00:00
Attach a default onError handler, logging to console.error (#706)
This commit is contained in:
parent
cc4c3cf94b
commit
c33dc49e40
@ -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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user