patch App and ActionError components to cleanup effect
This commit is contained in:
parent
ef0e53756e
commit
572a1dcf19
2 changed files with 3 additions and 1 deletions
|
@ -36,6 +36,8 @@ function App() {
|
|||
dispatch({type:'SOCKET', message: 'LAUNCH', body:{nsp:'', dispatch}});
|
||||
}
|
||||
socketConnect();
|
||||
|
||||
return () => dispatch({type: 'SOCKET', message: 'DISCONNECT', body: {}});
|
||||
}, [ state.connect ])
|
||||
|
||||
return (
|
||||
|
|
|
@ -2,7 +2,7 @@ import React from 'react';
|
|||
import './ActionError.scss';
|
||||
|
||||
const ActionError = (props) => {
|
||||
const errorMessage = props.error;
|
||||
const errorMessage = props.error || '';
|
||||
return (
|
||||
<span
|
||||
className="error error--action"
|
||||
|
|
Loading…
Reference in a new issue