# @eventrixComponent

This decorator use eventrix context and extend component by eventrix.

{% hint style="info" %}
"eventrixComponent" decorator is required if You want use any of eventrix component decorators
{% endhint %}

{% hint style="info" %}
If You want use hooks, hocs or component decorator You must use EventrixProvider in Your application. Go to "EventrixProvider" page in "Context" section for more details.
{% endhint %}

{% tabs %}
{% tab title="Javascript" %}

```jsx
import React from 'react';
import { eventrixComponent } from 'eventrix';

@eventrixComponent
class Counter extends React.Component {
    componentDidMount() {
        this.eventrix.emit('componentMounted');
    }
    render() {
        
        return (
            <div>Component with eventrix</div>
        );
    }
}

export default Counter;
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://eventrix.gitbook.io/eventrix/component-decorators/eventrixcomponent.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
