UNPKG

stream-chat-react

Version:

React components to create chat conversations or livestream style chat

13 lines (12 loc) 594 B
import React from 'react'; import { useTranslationContext } from '../../context/TranslationContext'; /** * UI component for error indicator in a Channel */ const UnMemoizedLoadingErrorIndicator = ({ error }) => { const { t } = useTranslationContext('LoadingErrorIndicator'); if (!error) return null; return React.createElement("div", null, t('Error: {{ errorMessage }}', { errorMessage: error.message })); }; export const LoadingErrorIndicator = React.memo(UnMemoizedLoadingErrorIndicator, (prevProps, nextProps) => prevProps.error?.message === nextProps.error?.message);