From f5d52d874adb45aa877a8361a3ec685f10877812 Mon Sep 17 00:00:00 2001 From: Jan Dvorak Date: Sat, 25 May 2024 16:02:33 +0200 Subject: [PATCH] Deprecation warning for withTracker --- packages/react-meteor-data/withTracker.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/react-meteor-data/withTracker.tsx b/packages/react-meteor-data/withTracker.tsx index 120cc58..e6301ee 100644 --- a/packages/react-meteor-data/withTracker.tsx +++ b/packages/react-meteor-data/withTracker.tsx @@ -1,5 +1,6 @@ import React, { forwardRef, memo } from 'react'; import { useTracker } from './useTracker'; +import { Meteor } from 'meteor/meteor'; type ReactiveFn = (props: object) => any; type ReactiveOptions = { @@ -10,6 +11,9 @@ type ReactiveOptions = { export const withTracker = (options: ReactiveFn | ReactiveOptions) => { return (Component: React.ComponentType) => { + if (Meteor.isDevelopment) { + console.warn('It appears that you are using withTracker. This approach has been deprecated and will be removed in future versions of the package. Please migrate to using hooks.') + } const getMeteorData = typeof options === 'function' ? options : options.getMeteorData;