import React, { Fragment } from 'react'; import PropTypes from 'prop-types'; function ErrorBox(props){ if (props.msg) { console.error(props.msg); } return ( { (props.msg)? (
{ (typeof props.msg === 'string' || props.msg instanceof String)? props.msg : 'Unexpected error' }
) : null }
); } ErrorBox.propTypes = { msg: PropTypes.string } export default ErrorBox;