mirror of
https://github.com/aleleba/test-list-app.git
synced 2025-04-19 02:28:04 -06:00
21 lines
442 B
TypeScript
21 lines
442 B
TypeScript
import React, { useEffect } from 'react';
|
|
import PrincipalRoutes from './PrincipalRoutes';
|
|
import { config } from '../../../config';
|
|
|
|
const App = () => {
|
|
if(config.ENV === 'development') {
|
|
useEffect(() => {
|
|
const ws = new WebSocket(`wss://${config.HOST}/ws`);
|
|
ws.onmessage = (event) => {
|
|
if (event.data === 'reload') {
|
|
window.location.reload();
|
|
}
|
|
};
|
|
}, []);
|
|
}
|
|
|
|
return <PrincipalRoutes />;
|
|
};
|
|
|
|
export default App;
|