meteor / react-packages

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

React 18 #345

Closed StorytellerCZ closed 2 years ago

StorytellerCZ commented 2 years ago

I did I quick test with React 18 RC and ran into issues of constant refreshes in withTracker HOC which I use to create my user context, so I just wanted to open this issue to get some visibility in the coming React 18 upgrade to see what steps needs to be taken to upgrade and what issues have others encountered.

CaptainN commented 2 years ago

I'll take a look. They are shipping useMutableSource with this. I'll look in to that as well.

CaptainN commented 2 years ago

This worked for me. I tried it with the unit tests, and I tried with a project with no trouble too. Can you provide more of a reproduction?

StorytellerCZ commented 2 years ago

Ok, will look into it, maybe it is something stupid in my code base.

CaptainN commented 2 years ago

BTW, useMutableSource looks like a total pain to use... I don't know if it's appropriate for Meteor, but we may be able to borrow some techniques for how to handle "updates during render". I'm still planning to look in to that, but our general approach with useFind and useTracker is probably better/easier to use than something based on useMutableSource.

filipenevola commented 2 years ago

@StorytellerCZ could you provide a reproduction? It would be nice to see what is going wrong in your case.

CaptainN commented 2 years ago

There seems to be a reproduction in #354 - @StorytellerCZ Can you verify if that demonstrates the same issue you saw?

StorytellerCZ commented 2 years ago

I have just tested with released version of React 18 and so far I'm not running into any issues. It might also be that when it comes to user stuff I have moved to the new official packages. I will take a look on #354 reproduction to see if it is similar to what I have been experiencing.

StorytellerCZ commented 2 years ago

@CaptainN after a quick read through the issue I think it is the same. I'm closing this issue in favor of #354