mobx-react

  • Version 7.2.0
  • Published
  • 610 kB
  • 1 dependency
  • MIT license

Install

npm i mobx-react
yarn add mobx-react
pnpm add mobx-react

Overview

React bindings for MobX. Create fully reactive components.

Index

Variables

variable PropTypes

const PropTypes: {
observableArray: any;
observableArrayOf: any;
observableMap: any;
observableObject: any;
arrayOrObservableArray: any;
arrayOrObservableArrayOf: any;
objectOrObservableObject: any;
};

    Functions

    function disposeOnUnmount

    disposeOnUnmount: {
    (target: any, propertyKey: PropertyKey): void;
    <TF extends Disposer | Disposer[]>(target: any, fn: TF): TF;
    };

      function inject

      inject: {
      (...stores: string[]): <T extends unknown>(
      target: T
      ) => T & (T extends any ? IWrappedComponent<P> : never);
      <S, P, I, C>(fn: IStoresToProps<S, P, I, C>): <T extends unknown>(
      target: T
      ) => T & IWrappedComponent<P>;
      };
      • higher order component that injects stores to a child. takes either a varargs list of strings, which are stores read from the context, or a function that manually maps the available stores from the context to props: storesToProps(mobxStores, props, context) => newProps

      Type Aliases

      type IWrappedComponent

      type IWrappedComponent<P> = {
      wrappedComponent: IReactComponent<P>;
      };

        Package Files (5)

        Dependencies (1)

        Dev Dependencies (2)

        Peer Dependencies (2)

        Badge

        To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

        You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/mobx-react.

        • Markdown
          [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/mobx-react)
        • HTML
          <a href="https://www.jsdocs.io/package/mobx-react"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>