Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. import io from 'socket.io-client'
  2.  
  3. const socket = io.connect(`${process.env.REACT_APP_SERVER_URL}`)
  4.  
  5. export const studentFunction = (studentID) => {
  6. socket.emit('getStudentDetails', {studentID})
  7.  
  8. socket.on('returnedStudentDetails', data => {
  9. return data //obviously this is not working
  10. })
  11. }
  12.  
  13. render(){
  14. let studentDetails = studentFunction(1)
  15. console.log(studentDetails)
  16.  
  17. return(
  18. .......
  19. )
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement