Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import {useEffect} from 'react';
import ChatAPI from './ChatAPI';
function ChatComponent() {
useEffect(() => {
ChatAPI.subscribe();
return () => {
ChatAPI.unsubscribe();
}
})
return <div>Chat Component</div>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment