File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
examples/create-react-app-example/src Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 11import React , { useState , useEffect } from 'react' ;
2+ import logo from './logo.svg' ;
23import './App.css' ;
34import io from 'socket.io-client' ;
45
@@ -23,7 +24,7 @@ function App() {
2324 socket . off ( 'disconnect' ) ;
2425 socket . off ( 'message' ) ;
2526 } ;
26- } ) ;
27+ } , [ ] ) ;
2728
2829 const sendMessage = ( ) => {
2930 socket . emit ( 'hello!' ) ;
@@ -32,9 +33,21 @@ function App() {
3233 return (
3334 < div className = "App" >
3435 < header className = "App-header" >
36+ < img src = { logo } className = "App-logo" alt = "logo" />
3537 < p > Connected: { '' + isConnected } </ p >
3638 < p > Last message: { lastMessage || '-' } </ p >
3739 < 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 >
3851 </ header >
3952 </ div >
4053 ) ;
You can’t perform that action at this time.
0 commit comments