Comment on page


This decorator register component method on component did mount as listener in eventrix and unregister when component will unmount.
"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, eventListener } from 'eventrix';
class Counter extends React.Component {
constructor(...args) {
this.state = {
counter: 0;
createCounter(eventData) {
this.setState({ counter: this.state.counter + 1 });
render() {
return (
<div>Created clients number: {this.state.counter}</div>
export default Counter;