LogoLogo
  • Eventrix
  • Introduction
    • Installation
    • Quick start
    • Getting started
    • Demo
    • About
  • Devtools - EventrixDebugger
  • Use cases
    • Handle errors
    • Simple form management
    • Communication between components
    • Next.js
    • Basic setup on project
    • Fetch list and display in component
  • CONTEXT
    • EventrixProvider
    • PersistStoreGate
    • EventrixScope
  • MIGRATION
    • Redux -> Eventrix
  • Receivers
    • EventsReceiver
    • RequestsHandler
    • fetchToStateReceiver
    • fetchStateReceiver
    • fetchHandler
  • HOC
    • withEventrix
    • withEventrixState
  • HOOKS
    • useEventrixState
    • useEmit
    • useEvent
    • useEventState
    • useFetchToState
    • useReceiver
    • useFetchState
  • CLASS DECORATORS
    • @useEventrix
    • @receiver
    • @fetchToState
    • @listener
  • COMPONENT DECORATORS
    • @eventrixComponent
    • @eventListener
    • @stateListener
    • @eventrixState
Powered by GitBook
On this page

Was this helpful?

  1. CONTEXT

EventrixProvider

EventrixProvider is required when You want use hooks, hocs and component decorators. Provider use react context API to pass all required data by context to hocs, hooks and component decorators. Use EventrixProvider in Your main component of Your application.

import React from "react";
import { EventrixProvider } from "eventrix";
import eventrix from "./eventrix";
import ListComponent from "./ListComponent";

const App = () => {
  return (
    <EventrixProvider eventrix={eventrix}>
      <div className="app-wrapper">
        <h1>MY NEW APP</h1>
        <div className="context">
          <ListComponent />
        </div>
      </div>
    </EventrixProvider>
  );
}

export default App;
PreviousFetch list and display in componentNextPersistStoreGate

Last updated 3 years ago

Was this helpful?