Function: observer()
See
https://mobx.js.org/react-integration.html
Call Signature
ts
function observer<P, TRef>(baseComponent: ForwardRefRenderFunction<TRef, P>, options: IObserverOptions & {
forwardRef: true;
}): MemoExoticComponent<ForwardRefExoticComponent<PropsWithoutRef<P> & RefAttributes<TRef>>>;Defined in: mobx-react-lite:
Type Parameters
| Type Parameter | Default type |
|---|---|
P extends object | - |
TRef | { } |
Parameters
| Parameter | Type |
|---|---|
baseComponent | ForwardRefRenderFunction<TRef, P> |
options | IObserverOptions & { forwardRef: true; } |
Returns
MemoExoticComponent<ForwardRefExoticComponent<PropsWithoutRef<P> & RefAttributes<TRef>>>
Call Signature
ts
function observer<P>(baseComponent: FunctionComponent<P>, options?: IObserverOptions): FunctionComponent<P>;Defined in: mobx-react-lite:
Type Parameters
| Type Parameter |
|---|
P extends object |
Parameters
| Parameter | Type |
|---|---|
baseComponent | FunctionComponent<P> |
options? | IObserverOptions |
Returns
FunctionComponent<P>
Call Signature
ts
function observer<P, TRef>(baseComponent: ForwardRefExoticComponent<PropsWithoutRef<P> & RefAttributes<TRef>>): MemoExoticComponent<ForwardRefExoticComponent<PropsWithoutRef<P> & RefAttributes<TRef>>>;Defined in: mobx-react-lite:
Type Parameters
| Type Parameter | Default type |
|---|---|
P extends object | - |
TRef | { } |
Parameters
| Parameter | Type |
|---|---|
baseComponent | ForwardRefExoticComponent<PropsWithoutRef<P> & RefAttributes<TRef>> |
Returns
MemoExoticComponent<ForwardRefExoticComponent<PropsWithoutRef<P> & RefAttributes<TRef>>>
Call Signature
ts
function observer<C, Options>(baseComponent: C, options?: Options): Options extends {
forwardRef: true;
} ? C extends ForwardRefRenderFunction<TRef, P> ? C & NamedExoticComponent<PropsWithoutRef<P> & RefAttributes<TRef>> & {
type: ForwardRefExoticComponent;
} : never : C & {
displayName: string;
};Defined in: mobx-react-lite:
Type Parameters
| Type Parameter |
|---|
C extends | FunctionComponent<any> | ForwardRefRenderFunction<any, { }> |
Options extends IObserverOptions |
Parameters
| Parameter | Type |
|---|---|
baseComponent | C |
options? | Options |
Returns
Options extends { forwardRef: true; } ? C extends ForwardRefRenderFunction<TRef, P> ? C & NamedExoticComponent<PropsWithoutRef<P> & RefAttributes<TRef>> & { type: ForwardRefExoticComponent; } : never : C & { displayName: string; }