mobx-react-lite

  • Version 4.1.0
  • Published
  • 423 kB
  • 1 dependency
  • MIT license

Install

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

Overview

Lightweight React bindings for MobX based on React 16.8+ and Hooks

Index

Variables

variable clearTimers

const clearTimers: any;

    variable Observer

    const Observer: typeof ObserverComponent;

      Functions

      function enableStaticRendering

      enableStaticRendering: (enable: boolean) => void;

        function isObserverBatched

        isObserverBatched: () => boolean;

          function isUsingStaticRendering

          isUsingStaticRendering: () => boolean;

            function observer

            observer: {
            <P extends object, TRef = {}>(
            baseComponent: React.ForwardRefRenderFunction<TRef, P>,
            options: IObserverOptions & { forwardRef: true }
            ): React.MemoExoticComponent<React.ForwardRefExoticComponent<any>>;
            <P extends object, TRef = {}>(
            baseComponent: React.ForwardRefExoticComponent<any>
            ): React.MemoExoticComponent<React.ForwardRefExoticComponent<any>>;
            <P extends object>(
            baseComponent: React.FunctionComponent<P>,
            options?: IObserverOptions
            ): React.FunctionComponent<P>;
            <C extends unknown, Options extends IObserverOptions>(
            baseComponent: C,
            options?: Options
            ): Options extends { forwardRef: true }
            ? C extends React.ForwardRefRenderFunction<infer TRef, infer P>
            ? any
            : never
            : C & { displayName: string };
            };

              function Observer

              Observer: typeof ObserverComponent;

                function observerBatching

                observerBatching: (reactionScheduler: any) => void;

                  function useAsObservableSource

                  useAsObservableSource: <TSource extends object>(current: TSource) => TSource;

                    function useLocalObservable

                    useLocalObservable: <TStore extends Record<string, any>>(
                    initializer: () => TStore,
                    annotations?: AnnotationsMap<TStore, never>
                    ) => TStore;

                      function useLocalStore

                      useLocalStore: {
                      <TStore extends Record<string, any>>(initializer: () => TStore): TStore;
                      <TStore extends Record<string, any>, TSource extends object>(
                      initializer: (source: TSource) => TStore,
                      current: TSource
                      ): TStore;
                      };

                        function useObserver

                        useObserver: <T>(fn: () => T, baseComponentName?: string) => T;

                          function useStaticRendering

                          useStaticRendering: (enable: boolean) => void;

                            Interfaces

                            interface IObserverOptions

                            interface IObserverOptions {}
                            • Deprecated

                              Observer options will be removed in the next major version of mobx-react-lite. Look at the individual properties for alternatives.

                            property forwardRef

                            readonly forwardRef?: boolean;
                            • Deprecated

                              Pass a React.forwardRef component to observer instead of using the options object e.g. observer(React.forwardRef(fn))

                            Package Files (8)

                            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-lite.

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