Skip to content

Commit 26b0587

Browse files
authored
Merge pull request #405 from meteor/feature/deprecate-withTracker
Deprecation warning for withTracker
2 parents 55752a9 + f5d52d8 commit 26b0587

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/react-meteor-data/withTracker.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React, { forwardRef, memo } from 'react';
22
import { useTracker } from './useTracker';
3+
import { Meteor } from 'meteor/meteor';
34

45
type ReactiveFn = (props: object) => any;
56
type ReactiveOptions = {
@@ -10,6 +11,9 @@ type ReactiveOptions = {
1011

1112
export const withTracker = (options: ReactiveFn | ReactiveOptions) => {
1213
return (Component: React.ComponentType) => {
14+
if (Meteor.isDevelopment) {
15+
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.')
16+
}
1317
const getMeteorData = typeof options === 'function'
1418
? options
1519
: options.getMeteorData;

0 commit comments

Comments
 (0)