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}});
|
dispatch({type:'SOCKET', message: 'LAUNCH', body:{nsp:'', dispatch}});
|
||||||
}
|
}
|
||||||
socketConnect();
|
socketConnect();
|
||||||
|
|
||||||
|
return () => dispatch({type: 'SOCKET', message: 'DISCONNECT', body: {}});
|
||||||
}, [ state.connect ])
|
}, [ state.connect ])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -2,7 +2,7 @@ import React from 'react';
|
||||||
import './ActionError.scss';
|
import './ActionError.scss';
|
||||||
|
|
||||||
const ActionError = (props) => {
|
const ActionError = (props) => {
|
||||||
const errorMessage = props.error;
|
const errorMessage = props.error || '';
|
||||||
return (
|
return (
|
||||||
<span
|
<span
|
||||||
className="error error--action"
|
className="error error--action"
|
||||||
|
|
Loading…
Reference in a new issue