title: why I am getting never type in useReducer in TS?
body: <p>I am making a reducer state of three values, <code>conversations</code>- intially empty array with the described properties, <code>messages</code> - intially empty array with described properties and <code>activeConversation</code> string. But I keep on getting typescript never errors. I don't understand. Can someone please resolve this for me ?</p>
  <pre><code>import { useReducer, useContext, createContext, FunctionComponent } from 'react';
  
  export interface IConversations {
    conversationId: string;
    latestMessage: {
      latestMessageText: string;
      createdAt: string;
    };
    recipientUser: {
      fullName: string;
      email: string;
      online: boolean;
      recipientUserId: string;
      profileImg?: string;
    };
  }
  
  export interface IMessages {
    _id: string;
    author: string;
    text: string;
    createdAt: string;
    updatedAt: string;
  }
  
  interface IMessageReducer {
    conversations: IConversations[];
    messages: IMessages[];
    activeConversation: string;
  }
  
  type Action =
    | { type: 'UPLOAD_PROFILE'; profileImg: string }
  
  type Dispatch = (action: Action) =&gt; void;
  
  interface IUseMessage {
    messageState: IMessageReducer;
    dispatchMessageContext: Dispatch;
  }
  
  const messageReducer = (state: IMessageReducer, action: Action) =&gt; {
    switch (action.type) {
      default:
        return state;
    }
  };
  
  const MessageContext = createContext({
    conversations: [],
    messages: [],
    activeConversations: ''
  });
  
  const MessageProvider: FunctionComponent = ({ children }): JSX.Element =&gt; {
    const [messageState, dispatchMessageContext] = useReducer(messageReducer, {
      conversations: [],
      messages: [],
      activeConversations: ''
    });
  
    return &lt;MessageContext.Provider value={{ messageState, dispatchMessageContext }}&gt;{children}&lt;/MessageContext.Provider&gt;
  }
  
  const useMessage = (): IMessageReducer =&gt; {
    const context = useContext(MessageContext);
    if (context === undefined) {
      throw new Error('useMessage must be used within a MessageProvider');
    }
    return context;
  }
  
  export { MessageProvider, useMessage }
  </code></pre>