meteor / react-packages

Meteor packages for a great React developer experience
http://guide.meteor.com/react.html
Other
571 stars 157 forks source link

Warning message in console when using withTracker in version 2.2.0 #311

Closed rj-david closed 3 years ago

rj-david commented 3 years ago

When using version 2.2.0, for a page using withTracker, we are getting this error in the console

Warning: useTracker expected an array in it's second argument (dependency), but got type of undefined.
filipenevola commented 3 years ago

Hi @rj-david, I see it.

@CaptainN removed from the condition a check for falsy values in this commit https://github.com/meteor/react-packages/commit/fd8e02fef66024a22079aa391a74ec9e115c315c.

Rework useTrackerWithDeps and others · meteor:react-packages@fd8e02f 2021-01-20 13-16-27

Was this on purpose? If so we should document this change.

Maybe the change was to keep it consistent with React useEffect but let's wait for @CaptainN here.

CaptainN commented 3 years ago

That's a bug. Will fix.

CaptainN commented 3 years ago

https://github.com/meteor/react-packages/pull/312

filipenevola commented 3 years ago

Hi @rj-david 2.2.1 is published and it fixes this issue.

thanks @CaptainN

rj-david commented 3 years ago

Confirming this fix