import React , { createContext , useContext } from 'react' ; import { SocketService } from './SocketService' ; export const ChatContext = createContext ( new SocketService ( ) ) ; export const useChat = ( ) => useContext ( ChatContext ) ;