---
sidebar_label: 'Editing Sent Messages'
---

import Link from '@docusaurus/Link';
import {CodeEditor} from '@site/src/components/CodeEditor/CodeEditor';
import app from './0007-edit-sent-messages/app';
import setup from './0007-edit-sent-messages/setup';

# Editing Sent Messages

This example shows how to edit a previously sent message in the chat interface.

Steps:

* Click on the message you want to edit.
* Edit
* Press `Enter` to regenerate.

<CodeEditor
    files={{
        'App.tsx': app,
        'setup.ts': setup,
    }}
    editorHeight={450}
    simulatedPrompt={false}
/>

---

<div style={{display: 'flex', justifyContent: 'flex-start', gap: '1rem'}}>
    <Link className="learn-more-link button button--secondary" to="/reference/api/usage">AI Chat API Reference</Link>
    <Link className="learn-more-link button button--secondary" to="/reference/ui/events">Events Reference</Link>
</div>
