/
githubmirror
/
algorithm-visualizer
Обзор
Документация
Войти
/
githubmirror
/
algorithm-visualizer
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/components/BaseComponent/index.js
23 строки
583 B
Jason Park
Rename jsx and scss files
09 июн 2019, 17:39
09 июн 2019, 17:39
60fcab5
Код
Авторство
О чём код?
import React from 'react'; class BaseComponent extends React.Component { constructor(props) { super(props); this.handleError = this.handleError.bind(this); } handleError(error) { if (error.response) { const { data, statusText } = error.response; const message = data ? typeof data === 'string' ? data : JSON.stringify(data) : statusText; console.error(message); this.props.showErrorToast(message); } else { console.error(error.message); this.props.showErrorToast(error.message); } } } export default BaseComponent;