Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import io from 'socket.io-client'
- const socket = io.connect(`${process.env.REACT_APP_SERVER_URL}`)
- export const studentFunction = (studentID) => {
- socket.emit('getStudentDetails', {studentID})
- socket.on('returnedStudentDetails', data => {
- return data //obviously this is not working
- })
- }
- render(){
- let studentDetails = studentFunction(1)
- console.log(studentDetails)
- return(
- .......
- )
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement