# Events in React Inline AI Assist

This section describes the Inline AI Assist events that will be triggered when appropriate actions are performed. The following events are available in the Inline AI Assist component.

## created

The Inline AI Assist component triggers the [created](../api/inline-ai-assist#created) event when the component rendering is completed.

{% tabs %}
{% highlight js tabtitle="index.jsx" %}
import { InlineAIAssistComponent } from '@syncfusion/ej2-react-interactive-chat';
import * as React from 'react';
import * as ReactDOM from 'react-dom';

function App() {

    const handleCreated = () => {
        // Your actions here
    }

    return (
        <InlineAIAssistComponent created={handleCreated} />
    );
}

ReactDOM.render(<App />, document.getElementById('container'));
{% endhighlight %}
{% highlight ts tabtitle="index.tsx" %}
import { InlineAIAssistComponent } from '@syncfusion/ej2-react-interactive-chat';
import * as React from 'react';
import * as ReactDOM from 'react-dom';

function App() {

    const handleCreated = () => {
        // Your actions here
    }

    return (
        <InlineAIAssistComponent created={handleCreated} />
    );
}

ReactDOM.render(<App />, document.getElementById('container'));
{% endhighlight %}
{% endtabs %}

## promptRequest

The [promptRequest](../api/inline-ai-assist#promptrequest) event is triggered when the prompt request is made in the Inline AI Assist component.

{% tabs %}
{% highlight js tabtitle="index.jsx" %}
import { InlineAIAssistComponent } from '@syncfusion/ej2-react-interactive-chat';
import * as React from 'react';
import * as ReactDOM from 'react-dom';

function App() {

    const handlePromptRequest = (args) => {
        // Your actions here
    }

    return (
        <InlineAIAssistComponent promptRequest={handlePromptRequest} />
    );
}

ReactDOM.render(<App />, document.getElementById('container'));
{% endhighlight %}
{% highlight ts tabtitle="index.tsx" %}
import { InlineAIAssistComponent, InlinePromptRequestEventArgs } from '@syncfusion/ej2-react-interactive-chat';
import * as React from 'react';
import * as ReactDOM from 'react-dom';

function App() {

    const handlePromptRequest = (args: InlinePromptRequestEventArgs) => {
        // Your actions here
    }

    return (
        <InlineAIAssistComponent promptRequest={handlePromptRequest} />
    );
}

ReactDOM.render(<App />, document.getElementById('container'));
{% endhighlight %}
{% endtabs %}

## open

The [open](../api/inline-ai-assist#open) event is triggered when the Inline AI Assist popup is opened.

{% tabs %}
{% highlight js tabtitle="index.jsx" %}
import { InlineAIAssistComponent } from '@syncfusion/ej2-react-interactive-chat';
import * as React from 'react';
import * as ReactDOM from 'react-dom';

function App() {

    const handlePopupOpen = (args) => {
        // Your actions here when popup opens
    }

    return (
        <InlineAIAssistComponent open={handlePopupOpen} />
    );
}

ReactDOM.render(<App />, document.getElementById('container'));
{% endhighlight %}
{% highlight ts tabtitle="index.tsx" %}
import { InlineAIAssistComponent } from '@syncfusion/ej2-react-interactive-chat';
import { OpenEventArgs } from '@syncfusion/ej2-popups';
import * as React from 'react';
import * as ReactDOM from 'react-dom';

function App() {

    const handlePopupOpen = (args: OpenEventArgs) => {
        // Your actions here when popup opens
    }

    return (
        <InlineAIAssistComponent open={handlePopupOpen} />
    );
}

ReactDOM.render(<App />, document.getElementById('container'));
{% endhighlight %}
{% endtabs %}

### close

The [close](../api/inline-ai-assist#close) event is triggered when the Inline AI Assist popup is closed.

{% tabs %}
{% highlight js tabtitle="index.jsx" %}
import { InlineAIAssistComponent } from '@syncfusion/ej2-react-interactive-chat';
import * as React from 'react';
import * as ReactDOM from 'react-dom';

function App() {

    const handlePopupClose = (args) => {
        // Your actions here when popup closes
    }

    return (
        <InlineAIAssistComponent close={handlePopupClose} />
    );
}

ReactDOM.render(<App />, document.getElementById('container'));
{% endhighlight %}
{% highlight ts tabtitle="index.tsx" %}
import { InlineAIAssistComponent } from '@syncfusion/ej2-react-interactive-chat';
import { CloseEventArgs } from '@syncfusion/ej2-popups';
import * as React from 'react';
import * as ReactDOM from 'react-dom';

function App() {

    const handlePopupClose = (args: CloseEventArgs) => {
        // Your actions here when popup closes
    }

    return (
        <InlineAIAssistComponent close={handlePopupClose} />
    );
}

ReactDOM.render(<App />, document.getElementById('container'));
{% endhighlight %}
{% endtabs %}