meteor / react-packages

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

After upgrading to react v18, components rendered through react-template-helper does not get latest value of ReactiveVar #399

Open yash-indecab opened 1 year ago

yash-indecab commented 1 year ago

Hello everyone,

We've recently upgraded to React v18 and also updated to latest version of react-template-helper and have encountered an issue that requires some attention.

In our previous setup with React 16, we used to pass ReactiveVars as props, and the .get() method reliably provided us with the updated value of the ReactiveVar. However, after transitioning to React 18, our components stopped rendering as expected. Notably, in React 16, we depended on componentWillReceiveProps, but in React 18, it appears that even UNSAFE_componentWillReceiveProps isn't getting triggered.

To help you better understand the problem, we've created a repository that reproduces this issue. You can find it here: Repo that reproduces this bug.

We would greatly appreciate any assistance or insights you can provide. Our aim is to resolve this issue and continue working effectively with React v18. Thank you for your help.