File tree 1 file changed +14
-1
lines changed
examples/create-react-app-example/src
1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 1
1
import React , { useState , useEffect } from 'react' ;
2
+ import logo from './logo.svg' ;
2
3
import './App.css' ;
3
4
import io from 'socket.io-client' ;
4
5
@@ -23,7 +24,7 @@ function App() {
23
24
socket . off ( 'disconnect' ) ;
24
25
socket . off ( 'message' ) ;
25
26
} ;
26
- } ) ;
27
+ } , [ ] ) ;
27
28
28
29
const sendMessage = ( ) => {
29
30
socket . emit ( 'hello!' ) ;
@@ -32,9 +33,21 @@ function App() {
32
33
return (
33
34
< div className = "App" >
34
35
< header className = "App-header" >
36
+ < img src = { logo } className = "App-logo" alt = "logo" />
35
37
< p > Connected: { '' + isConnected } </ p >
36
38
< p > Last message: { lastMessage || '-' } </ p >
37
39
< button onClick = { sendMessage } > Say hello!</ button >
40
+ < p >
41
+ Edit < code > src/App.js</ code > and save to reload.
42
+ </ p >
43
+ < a
44
+ className = "App-link"
45
+ href = "https://reactjs.org"
46
+ target = "_blank"
47
+ rel = "noopener noreferrer"
48
+ >
49
+ Learn React
50
+ </ a >
38
51
</ header >
39
52
</ div >
40
53
) ;
You can’t perform that action at this time.
0 commit comments