@eventrixComponent

This decorator use eventrix context and extend component by eventrix.

"eventrixComponent" decorator is required if You want use any of eventrix component decorators

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.

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;

Last updated