본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

Chat - 오류 처리

원문 보기 위키 갱신

Chat - 오류 처리 (Error handling)

통합된 오류 모델을 통해 어댑터, 스트림, 기록 로딩에서 발생하는 오류를 처리합니다.

출처: MUI X documentation

본문

채팅 런타임은 어댑터, 스트림, 기록 로딩에서 발생한 오류를 포착해 통합된 오류 모델로 표출합니다. 어댑터 메서드 안에서 오류를 직접 잡을 필요가 없습니다. 런타임이 대신 처리해 줍니다.

인터랙티브 플레이그라운드 (Interactive playground)

아래 데모에서는 메시지 오류를 토글하고 실패한 메시지 아래 렌더링되는 ChatMessageError 컴포넌트를 확인할 수 있습니다:

import * as React from 'react';
import Box from '@mui/material/Box';
import Typography from '@mui/material/Typography';
import { ChatMessage } from '@mui/x-chat';
import type {
  ChatConversation,
  ChatMessage as ChatMessageEntity,
} from '@mui/x-chat/headless';
import { PlaygroundCard } from 'docs/src/modules/components/chat-playground/PlaygroundCard';
import {
  MessageErrorEffect,
  ScopedChat,
} from 'docs/src/modules/components/chat-playground/sharedProviders';
import {
  ChoiceControl,
  DividerLabel,
  SwitchControl,
  TextControl,
} from 'docs/src/modules/components/chat-playground/controls';
import {
  useCustomizations,
  type CustomizationDef,
} from 'docs/src/modules/components/chat-playground/useCustomizations';
import { users } from 'docs/src/modules/components/chat-playground/data';

const conversation: ChatConversation = {
  id: 'error-playground',
  title: 'Error preview',
  participants: [users.me, users.assistant],
};

const message: ChatMessageEntity = {
  // A user message: the built-in retry button only renders for user messages
  // (retrying re-sends the original prompt), so the `retryable` toggle below is
  // only meaningful here.
  id: 'error-msg',
  conversationId: conversation.id,
  role: 'user',
  author: users.me,
  createdAt: '2026-05-03T10:00:00.000Z',
  status: 'error',
  parts: [{ type: 'text', text: 'This message failed to send.' }],
};

type ErrorCode = 'SEND_ERROR' | 'STREAM_ERROR' | 'HISTORY_ERROR' | 'REALTIME_ERROR';

type ClassKey = 'root' | 'message' | 'retryButton';

const CLASS_DEFS: ReadonlyArray<CustomizationDef<ClassKey>> = [
  { name: 'root', description: 'The error card root element.' },
  {
    name: 'message',
    selector: '.MuiChatMessageError-message',
    description: 'The error message text.',
  },
  {
    name: 'retryButton',
    selector: '.MuiChatMessageError-retryButton',
    description: 'The retry button.',
  },
];

export default function ChatMessageErrorPlayground() {
  const [enabled, setEnabled] = React.useState(true);
  const [code, setCode] = React.useState<ErrorCode>('SEND_ERROR');
  const [retryable, setRetryable] = React.useState(true);
  const [text, setText] = React.useState('Could not reach the chat server.');
  const classesCustomizations = useCustomizations<ClassKey>(CLASS_DEFS);

  const errorRowSx = classesCustomizations.toClassesSx();

  return (
    <PlaygroundCard
      title="ChatMessageError"
      description="Inline error using palette.error tokens — rendered under failed messages."
      previewMinHeight={220}
      span={2}
      classCustomizations={classesCustomizations.customizations}
      onClassesReset={classesCustomizations.reset}
      controls={
        <React.Fragment>
          <DividerLabel>state (message error)</DividerLabel>
          <SwitchControl
            label="error enabled"
            checked={enabled}
            onChange={setEnabled}
            helperText="Toggles store.setMessageError(messageId, …)."
          />
          <ChoiceControl<ErrorCode>
            label="code"
            value={code}
            options={
              [
                'SEND_ERROR',
                'STREAM_ERROR',
                'HISTORY_ERROR',
                'REALTIME_ERROR',
              ] as const
            }
            onChange={setCode}
          />
          <TextControl
            label="message"
            value={text}
            onChange={setText}
            multiline
            rows={2}
          />
          <SwitchControl
            label="retryable"
            checked={retryable}
            onChange={setRetryable}
            helperText="Drives whether the retry button is rendered."
          />
        </React.Fragment>
      }
      preview={
        <ScopedChat
          conversations={[conversation]}
          messages={[message]}
          activeConversationId={conversation.id}
        >
          <MessageErrorEffect
            messageId={message.id}
            enabled={enabled}
            errorCode={code}
            errorMessage={text}
            retryable={retryable}
          />
          <Box
            sx={{
              width: '100%',
              display: 'flex',
              flexDirection: 'column',
              gap: 1,
              ...errorRowSx,
            }}
          >
            {/*
              The retry button rendered inside ChatMessageError already calls the
              public useChat().retry(messageId) action for you — no extra wiring
              is needed here.
            */}
            <ChatMessage messageId={message.id} />
            <Typography variant="caption" color="text.secondary" sx={{ pl: 1 }}>
              {enabled
                ? `ChatError — code: ${code} · retryable: ${retryable}`
                : 'Error disabled'}
            </Typography>
          </Box>
        </ScopedChat>
      }
    />
  );
}

오류 전파 (Error propagation)

어댑터 메서드가 오류를 던지면 런타임은:

  1. 적절한 source와 code를 가진 ChatError를 기록합니다.
  2. ChatBox의 내장 오류 UI, useChat().error, onError 콜백을 통해 이를 표출합니다.
  3. 적용 가능한 경우 오류를 recoverable로 표시하고(예: 스트림 연결 끊김), 사용자가 다시 시도할 수 있으면 retryable로 표시합니다.

두 오류 표면 모두 보조 기술에 안내됩니다: headless MessageError 프리미티브는 role="alert"로 렌더링되고, Material ChatMessageError 카드는 aria-live="polite"와 aria-atomic="true"를 사용해 마운트 시 기존 오류가 다시 안내되지 않게 합니다.

애플리케이션 수준에서 오류 처리 (Handling errors at the application level)

애플리케이션 수준에서 오류를 처리하려면 ChatBox의 onError prop을 사용하세요:

<ChatBox
  adapter={adapter}
  onError={(error) => {
    console.error(`[Chat error] ${error.source}: ${error.message}`);

    // Report to your error tracking service
    errorTracker.capture(error);
  }}
/>

아래 데모는 sendMessage()가 실패했을 때 ChatBox가 표출하는 기본 오류 UI를 보여 줍니다:

'use client';
import * as React from 'react';
import Alert from '@mui/material/Alert';
import { ChatBox } from '@mui/x-chat';
import {
  minimalConversation,
  minimalMessages,
  demoUsers,
} from 'docs/data/chat/core/examples/shared/demoData';
import type { ChatAdapter } from '@mui/x-chat/headless';

const demoMembers = [demoUsers.you, demoUsers.agent];

const failingAdapter: ChatAdapter = {
  async sendMessage() {
    // Simulate network delay then fail
    await new Promise((resolve) => {
      setTimeout(resolve, 800);
    });
    throw new Error(
      'Network error: Unable to reach the server. Please check your connection.',
    );
  },
};

export default function ErrorState() {
  const [errorMessage, setErrorMessage] = React.useState<string | null>(null);

  return (
    <div style={{ width: '100%' }}>
      <ChatBox
        adapter={failingAdapter}
        members={demoMembers}
        initialActiveConversationId={minimalConversation.id}
        initialConversations={[minimalConversation]}
        initialMessages={minimalMessages}
        onError={(error) => {
          setErrorMessage(error.message ?? 'An unknown error occurred');
        }}
        sx={{
          height: 460,
          border: '1px solid',
          borderColor: 'divider',
          borderRadius: 1,
        }}
      />
      {errorMessage && (
        <Alert severity="error" sx={{ mt: 1 }}>
          Error: {errorMessage}
        </Alert>
      )}
    </div>
  );
}

오류 객체 구조 (Error object structure)

런타임이 기록하는 모든 오류는 ChatError로 표현됩니다:

interface ChatError {
  code: ChatErrorCode;
  message: string;
  source: ChatErrorSource;
  recoverable: boolean;
  retryable?: boolean;
  details?: Record<string, unknown>;
}

오류 코드 (Error codes)

Code Description
SEND_ERROR 어댑터의 sendMessage()가 오류를 던졌습니다.
STREAM_ERROR 스트림이 실패하거나 예기치 않게 끊겼습니다.
HISTORY_ERROR 메시지 기록 로딩에 실패했습니다.
REALTIME_ERROR 실시간 구독에서 오류가 발생했습니다.
REGENERATE_ERROR 어시스턴트 응답 재생성에 실패했습니다.

오류 소스 (Error sources)

Source Description
'send' 메시지 전송 중 오류.
'stream' 스트림 처리 중 오류.
'history' 기록 로딩 중 오류.
'render' 컴포넌트 렌더링 중 오류.
'adapter' 일반 어댑터 오류.

recoverable vs retryable

  • recoverable: 런타임이 이 오류에서 자동으로 복구할 수 있습니다(예: reconnectToStream()으로 끊긴 스트림을 다시 연결). 스트림 끊김 복구를 참고하세요.
  • retryable: 사용자가 작업을 다시 시도할 수 있습니다(예: 실패한 메시지 재전송).

오류 상태 접근 (Accessing the error state)

useChat() 훅은 현재 오류를 노출합니다:

import { useChat } from '@mui/x-chat/headless';

function ErrorBanner() {
  const { error, setError } = useChat();

  if (!error) return null;

  return (
    <div role="alert">
      <p>{error.message}</p>
      <button onClick={() => setError(null)}>Dismiss</button>
    </div>
  );
}

실패한 메시지 재시도 (Retrying failed messages)

sendMessage()가 실패하면 사용자의 메시지는 스레드에 남아 있고(낙관적 업데이트) 컴포저가 다시 활성화되어 사용자가 다시 시도할 수 있습니다.

useChat() 훅은 주어진 메시지 ID와 연결된 메시지를 다시 보내는 retry 메서드를 제공합니다:

import { useChat } from '@mui/x-chat/headless';

function RetryButton({ messageId }: { messageId: string }) {
  const { retry } = useChat();

  return <button onClick={() => retry(messageId)}>Retry</button>;
}

retry(messageId)는 ID로 원래 사용자 메시지를 찾아 어댑터의 sendMessage()를 통해 다시 제출하고 이전의 오류 상태를 대체합니다. retry(messageId)는 전송이나 스트림이 이미 진행 중일 때, 그리고 role이 'user'가 아닌 메시지의 경우 아무 작업도 하지 않습니다. 내장 ChatMessageError 재시도 버튼은 이런 경우 스스로 비활성화됩니다.

아래 데모는 첫 번째 전송 시도를 실패시킨 다음 Retry를 클릭하면 성공합니다:

'use client';
import * as React from 'react';
import Alert from '@mui/material/Alert';
import { ChatBox } from '@mui/x-chat';
import type { ChatAdapter, ChatError } from '@mui/x-chat/headless';
import {
  minimalConversation,
  minimalMessages,
  demoUsers,
} from 'docs/data/chat/core/examples/shared/demoData';
import {
  createChunkStream,
  createTextResponseChunks,
} from 'docs/data/chat/core/examples/shared/demoUtils';

const demoMembers = [demoUsers.you, demoUsers.agent];

function useFlakyAdapter(): ChatAdapter {
  // Tracks the message ids that already failed once. The first attempt for a
  // given id always throws; the retry (same id) succeeds.
  const failedOnce = React.useRef(new Set<string>());

  return React.useMemo<ChatAdapter>(
    () => ({
      async sendMessage({ message }) {
        if (!failedOnce.current.has(message.id)) {
          failedOnce.current.add(message.id);
          throw new Error(
            'Network error: the first attempt always fails in this demo.',
          );
        }

        return createChunkStream(
          createTextResponseChunks(
            `${message.id}-reply`,
            'Recovered! The retry reached the server and this reply streamed in.',
            { author: demoUsers.agent },
          ),
        );
      },
    }),
    [],
  );
}

export default function RetryRecovery() {
  const adapter = useFlakyAdapter();
  const [error, setError] = React.useState<ChatError | null>(null);

  return (
    <div style={{ width: '100%' }}>
      <ChatBox
        adapter={adapter}
        members={demoMembers}
        initialActiveConversationId={minimalConversation.id}
        initialConversations={[minimalConversation]}
        initialMessages={minimalMessages}
        onError={setError}
        onFinish={({ isError, isAbort, isDisconnect }) => {
          // A successful retry streams a reply to completion — clear the banner.
          if (!isError && !isAbort && !isDisconnect) {
            setError(null);
          }
        }}
        sx={{
          height: 460,
          border: '1px solid',
          borderColor: 'divider',
          borderRadius: 1,
        }}
      />
      {error && (
        <Alert severity="error" sx={{ mt: 1 }}>
          {error.code} · {error.source} · recoverable: {String(error.recoverable)} ·
          retryable: {String(error.retryable ?? false)}
        </Alert>
      )}
    </div>
  );
}

어댑터 메서드의 오류 (Error from adapter methods)

런타임에 오류를 표출하기 위해 어댑터 메서드를 try/catch로 감쌀 필요는 없지만, 관찰 가능성(observability) 플랫폼에 기록하기 위해 감싸는 것이 좋습니다. 런타임이 보기 전에 오류를 변형하거나 보강하려면 사용자 지정 메시지가 담긴 일반 Error를 던지세요. 런타임은 이를 source가 'adapter'인 ChatError로 감쌉니다:

async sendMessage({ message, signal }) {
  try {
    const res = await fetch('/api/chat', {
      method: 'POST',
      body: JSON.stringify({ message }),
      signal,
    });

    if (!res.ok) {
      throw new Error(`Server responded with ${res.status}`);
    }

    return res.body!;
  } catch (error) {
    // Log to Sentry, Datadog, or your error-tracking platform
    console.error('Adapter sendMessage failed:', error);
    // Re-throw so the runtime can surface the failure to the user
    throw error;
  }
},

스트림 끊김 복구 (Stream disconnect recovery)

스트림이 종료 청크(finish 또는 abort) 없이 닫히면 런타임은:

  1. 복구 가능한(recoverable) 스트림 오류를 기록합니다.
  2. 메시지 상태를 'error'로 설정합니다.
  3. isDisconnect: true로 onFinish를 호출합니다.
  4. 어댑터에 reconnectToStream()이 구현되어 있으면 스트림을 재개하려 한 번 시도합니다.
  5. 끊김이 복구되지 않은 경우에만 onError를 호출합니다.

자세한 내용은 스트림 다시 연결을 참고하세요.

메시지 상태와 오류 (Message status and errors)

메시지 status 필드는 오류 상태를 반영합니다:

Status Description
'pending' 메시지가 대기 중이지만 아직 어댑터에 전달되지 않았습니다.
'sending' 메시지를 보내는 중입니다(낙관적 업데이트).
'streaming' 어시스턴트 응답이 스트리밍 중입니다.
'sent' 메시지가 전송되고 응답이 완료되었습니다.
'read' 메시지가 전달되고 읽음으로 표시되었습니다(읽음 확인).
'error' 전송 또는 스트리밍 중 오류가 발생했습니다.
'cancelled' 스트림이 사용자에 의해 중단되었습니다.

컴포넌트는 status 필드를 사용해 오류 표시기를 조건부로 렌더링할 수 있습니다:

function MessageBubble({ message }: { message: ChatMessage }) {
  return (
    <div>
      {message.parts.map((part) => /* render parts */}
      {message.status === 'error' && (
        <span className="error-badge">Failed to send</span>
      )}
    </div>
  );
}

자신만의 컴포넌트에서 단일 메시지의 오류를 읽으려면 useMessageError(messageId) 훅을 사용하세요.

함께 보기 (See also)

  • 스트림 수명 주기와 끊김 처리는 스트리밍을 참고하세요.
  • 어댑터 인터페이스와 오류 전파 세부 사항은 어댑터를 참고하세요.

ChatBox API

데모 (Demos)

이 React 컴포넌트의 사용법에 대한 예시와 자세한 내용은 컴포넌트 데모 페이지를 참고하세요:

가져오기 (Import)

import { ChatBox } from '@mui/x-chat/ChatBox';
// or
import { ChatBox } from '@mui/x-chat';

Props

Name Type Default Required Description
classes object - No 컴포넌트에 적용되는 스타일을 덮어쓰거나 확장합니다.
currentUser { avatarUrl?: string, displayName?: string, id: string, isOnline?: bool, metadata?: object, role?: 'assistant' | 'system' | 'user' } - No
density 'comfortable' | 'compact' | 'standard' 'standard' No
features { attachments?: { acceptedMimeTypes?: Array<string>, maxFileCount?: number, maxFileSize?: number, onAttachmentReject?: func } | bool, autoScroll?: { buffer?: number } | bool, conversationHeader?: bool, conversationList?: bool, dateDivider?: bool, helperText?: bool, scrollToBottom?: bool, streamingIndicator?: 'auto' | bool, suggestions?: bool, typingSignal?: bool, unreadMarker?: bool } - No
getMessageAuthorAvatarUrl func (message) => message.author?.avatarUrl No
getMessageAuthorDisplayName func (message) => message.author?.displayName No
getMessageAuthorId func (message) => message.author?.id No
initialActiveConversationId string - No
initialComposerValue string - No
initialConversations Array<{ avatarUrl?: string, id: string, lastMessageAt?: string, metadata?: object, participants?: Array<{ avatarUrl?: string, displayName?: string, id: string, isOnline?: bool, metadata?: object, role?: 'assistant' | 'system' | 'user' }>, readState?: 'read' | 'unread', subtitle?: string, title?: string, unreadCount?: number }> - No
initialMessages Array<{ author?: { avatarUrl?: string, displayName?: string, id: string, isOnline?: bool, metadata?: object, role?: 'assistant' | 'system' | 'user' }, conversationId?: string, createdAt?: string, editedAt?: string, id: string, metadata?: object, parts: Array<{ data: any, id?: string, transient?: bool, type: object } | { filename?: string, mediaType: string, type: 'file', url: string } | { sourceId: string, text?: string, title?: string, type: 'source-document' } | { sourceId: string, title?: string, type: 'source-url', url: string } | { state?: 'done' | 'streaming', text: string, type: 'reasoning' } | { state?: 'done' | 'streaming', text: string, type: 'text' } | { toolInvocation: { approval?: object, approvalId?: string, callProviderMetadata?: object, errorText?: string, input?: any, output?: any, preliminary?: bool, providerExecuted?: bool, state: 'approval-requested' | 'approval-responded' | 'input-available' | 'input-streaming' | 'output-available' | 'output-denied' | 'output-error', title?: string, toolCallId: string, toolName: string }, type: 'dynamic-tool' } | { toolInvocation: { approval?: object, approvalId?: string, callProviderMetadata?: object, errorText?: string, input?: any, output?: any, preliminary?: bool, providerExecuted?: bool, state: 'approval-requested' | 'approval-responded' | 'input-available' | 'input-streaming' | 'output-available' | 'output-denied' | 'output-error', title?: string, toolCallId: string, toolName: string }, type: 'tool' } | { type: 'step-start' }>, role: 'assistant' | 'system' | 'user', status?: 'cancelled' | 'error' | 'pending' | 'read' | 'sending' | 'sent' | 'streaming', updatedAt?: string }> - No
layoutMode 'overlay' | 'split' | 'standard' - No
layoutModeBreakpoints { overlay?: number, split?: number } - No
members Array<{ avatarUrl?: string, displayName?: string, id: string, isOnline?: bool, metadata?: object, role?: 'assistant' | 'system' | 'user' }> - No
roleDisplayNames { assistant?: string, system?: string, user?: string } - No
slotProps object - No
slots object - No
storeClass func ChatStore No
streamFlushInterval number 16 No
suggestions Array<{ label?: string, value: string } | string> - No
suggestionsAutoSubmit bool false No
variant 'compact' | 'default' 'default' No

Note: ref는 루트 요소로 전달됩니다.

제공된 다른 모든 props는 루트 요소(네이티브 요소)에 전달됩니다.

Slots

Name Default Class Description
root undefined .MuiChatBox-root 가장 바깥쪽 ChatBox 컨테이너 요소.
layout undefined .MuiChatBox-layout 대화창 패널과 스레드 패널을 배치하는 래퍼.
conversationsPane undefined .MuiChatBox-conversationsPane 대화 목록 사이드바(좁은 너비에서는 드로어)용 컨테이너.
threadPane undefined .MuiChatBox-threadPane 활성 스레드용 컨테이너 — 메시지 목록과 컴포저.
conversationRoot undefined - ``의 스타일된 루트(래퍼 전용); 기본 헤더,
메시지 목록과 컴포저가 그 안에 계속 렌더링됩니다.
conversationList undefined - 대화 목록 사이드바 컴포넌트.
conversationHeader undefined - 메시지 목록 위에 렌더링되는 헤더 바.
conversationHeaderInfo undefined - 헤더 안의 제목 + 부제목 그룹.
conversationTitle undefined - 대화 제목 요소.
conversationSubtitle undefined - 대화 부제목 요소(참가자, 상태 등).
conversationHeaderActions undefined - 헤더의 끝쪽에 있는 동작 영역.
messageList undefined - ``의 스타일된 스크롤 가능한 루트 요소(래퍼 전용).
기본 메시지 행이 그 안에 렌더링되므로 'section' 같은 일반 요소가
목록을 대체하지 않고 감쌉니다.
messageGroup undefined - 연속된 메시지를 감싸는 작성자별 그룹 래퍼.
dateDivider undefined - 메시지 그룹 사이에 렌더링되는 날짜 구분선. features.dateDivider
가 활성화된 경우에만 렌더링됩니다. 숨기려면 null을 전달하세요.
unreadMarker undefined - "새 메시지" 마커. features.unreadMarker가 활성화된 경우에만
렌더링됩니다. 숨기려면 null을 전달하세요.
streamingIndicator undefined - 어시스턴트 응답이 진행되는 동안 표시되는 애니메이션 점:
응답 시작을 기다리는 동안엔 끝에 있는 행으로, 스트리밍 중에는
어시스턴트 말풍선 안에 표시됩니다. features.streamingIndicator
(기본값 'auto')로 제어됩니다. 숨기려면 null을 전달하세요.
messageRoot undefined - ``의 스타일된 루트(래퍼 전용); 기본 아바타/콘텐츠/메타
트리가 그 안에 계속 렌더링됩니다.
messageAvatar undefined - 아바타 컴포넌트. 아바타를 완전히 숨기고 예약된 아바타 그리드 트랙을
제거하려면 null을 전달하세요.
messageContent undefined - 메시지 말풍선 컴포넌트.
messageMeta undefined - 외부 메타(컴팩트 변형). 숨기려면 null을 전달하세요.
messageInlineMeta undefined - 말풍선 안에 렌더링되는 인라인 메타(기본 변형). 숨기려면 null을 전달하세요.
messageError undefined - 메시지 상태가 error일 때 말풍선 아래 표시되는 오류 카드.
오류 표면을 완전히 숨기려면 null을 전달하세요(컴포넌트가 마운트되지 않음).
messageActions undefined - 동작 행 컴포넌트({ messageId }를 받음). 동작을 완전히 숨기려면
null을 전달하세요; 생략하면 제공된 경우 slotProps.messageActions의
선언적 extraActions만 렌더링합니다.
messageAuthorName undefined - 그룹 래퍼가 렌더링하는 작성자 이름 라벨(기본 변형: 말풍선 위;
컴팩트 변형: 메시지 그리드 안). 숨기려면 null을 전달하세요.
composerRoot undefined - ``의 스타일된 루트(래퍼 전용); 기본 첨부/입력/전송/
툴바가 그 안에 렌더링됩니다.
composerInput undefined - 자동 크기 조절 텍스트 입력.
composerSendButton undefined - 전송 버튼. 숨기려면 null을 전달하세요; 폼은 Enter로 계속 제출됩니다.
composerAttachButton undefined - 첨부 버튼. 첨부 파이프라인(드래그/드롭, 붙여넣기)의 나머지를 유지하면서
버튼만 숨기려면 null을 전달하세요. 첨부를 완전히 비활성화하려면
features.attachments: false를 사용하세요.
composerAttachmentList undefined - 대기 중인 첨부 미리보기 목록.
composerToolbar undefined - 컴포저 툴바(버튼 행).
composerHelperText undefined - 입력 아래의 도움말 / 고지 사항 텍스트.
typingIndicator undefined - 어시스턴트가 응답하는 동안 표시되는 애니메이션 타이핑 표시기.
scrollToBottom undefined - 떠 있는 맨 아래로 스크롤 버튼.
suggestions undefined - 프롬프트 제안 칩.
emptyState undefined - 스레드에 메시지가 없을 때 렌더링되는 사용자 지정 콘텐츠.

소스 코드 (Source code)

이 페이지에서 찾지 못한 정보가 있다면 컴포넌트 구현을 살펴보세요.

ChatMessageError API

데모 (Demos)

이 React 컴포넌트의 사용법에 대한 예시와 자세한 내용은 컴포넌트 데모 페이지를 참고하세요:

가져오기 (Import)

import { ChatMessageError } from '@mui/x-chat/ChatMessageError';
// or
import { ChatMessageError } from '@mui/x-chat';

Note: ref는 루트 요소로 전달됩니다.

제공된 다른 모든 props는 루트 요소(네이티브 요소)에 전달됩니다.

CSS

규칙 이름 (Rule name)

Global class Rule name Description
- message 메시지 텍스트 요소에 적용되는 스타일.
- retryButton 재시도 버튼에 적용되는 스타일.
- root 루트 요소에 적용되는 스타일.

소스 코드 (Source code)

이 페이지에서 찾지 못한 정보가 있다면 컴포넌트 구현을 살펴보세요.

더 알아보기 (Learn more)