Skip to content

Commit

Permalink
Revert "deprecate IObserver options and its properties in JSDoc (#3939
Browse files Browse the repository at this point in the history
)"

This reverts commit 51354c2.
  • Loading branch information
mweststrate authored Oct 15, 2024
1 parent 51354c2 commit 4e01d40
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions packages/mobx-react-lite/src/observer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,13 @@ const ReactMemoSymbol = hasSymbol
? Symbol.for("react.memo")
: typeof memo === "function" && memo((props: any) => null)["$$typeof"]

/**
* @deprecated Observer options will be removed in the next major version of mobx-react-lite.
* Look at the individual properties for alternatives.
*/
export interface IObserverOptions {
/**
* @deprecated Pass a `React.forwardRef` component to observer instead of using the options object
* e.g. `observer(React.forwardRef(fn))`
*/
readonly forwardRef?: boolean
}

export function observer<P extends object, TRef = {}>(
baseComponent: React.ForwardRefRenderFunction<TRef, P>,
options: IObserverOptions & {
/**
* @deprecated Pass a `React.forwardRef` component to observer instead of using the options object
* e.g. `observer(React.forwardRef(fn))`
*/
forwardRef: true
}
options: IObserverOptions & { forwardRef: true }
): React.MemoExoticComponent<
React.ForwardRefExoticComponent<React.PropsWithoutRef<P> & React.RefAttributes<TRef>>
>
Expand Down

0 comments on commit 4e01d40

Please sign in to comment.