UNPKG

stream-chat-react

Version:

React components to create chat conversations or livestream style chat

8 lines (7 loc) 361 B
import React, { useContext } from 'react'; export const PollContext = React.createContext(undefined); export const PollProvider = ({ children, poll, }) => poll ? (React.createElement(PollContext.Provider, { value: { poll } }, children)) : null; export const usePollContext = () => { const contextValue = useContext(PollContext); return contextValue; };