-
Notifications
You must be signed in to change notification settings - Fork 366
React update all+move to functional components with hooks #277
React update all+move to functional components with hooks #277
Conversation
Some meteor packages still need to be updated, like aldeed:collection2, but can cause problems.
GlobalStateProvider, LocaleProvider, useLocale, MenuOpenProvider, useMenuOpen
Use the menuOpen global state to manage the menu opening through a transition transform from a state to a reactive var
Call useMenuOpen though it does not need menuOpen because its children still need it though props.
Remove unnecessary imports, remove transitional menuOpen
I18n is broken on this page and NotFound, since inherited BaseComponent was in charge of it
Move Authpage content to children, remove all unnecessary menuOpen, and a few more
…native confirm dialog
Following @HorusGoul suggestions
And extract i18n call following @HorusGoul suggestions
Update react-router-dom and a few other packages that had been left unupdated using npm-check-update Remove all Redirect components Transfer redirection from App component to AppContent component
Implement @HorusGoul solution using custom useUnmountedRef hook
After these last commits, tests are still broken but it's getting better. 3 of clients tests still don't pass I don't know why.
|
Just sent you a PR with some changes to solve these issues. Regarding |
…nal-components-with-hooks Ignore import/no-cycle rule and remove enzyme tests
Anything else needs some changes? |
Nope, I think we can already merge this, thank you for your collaboration 🎆 |
I also started the todo react example using hooks from the beginning and ran into troubles when adding the withTracker code. I came across this issue. Is what I'm reading here about making Metor work with hooks, or just the react todo example? |
@thanateros Meteor does work with hooks, and it doesn't conflict with withTracker: this PR is about updating the todo example and make it use hooks. You can have a look at the code to see how it achieves that. withTracker has also been rewritten as a useTracker hook, but it hasn't been published yet: it is currently worked on. |
@cvolant Thanks for the explanation. |
Great, thanks @cvolant and @HorusGoul 🎉 @cvolant what about you making a tweet about this update and then we can RT? |
Good idea. But I don’t have Twitter... 🙃 Nor Facebook. |
Locale and menuOpen are handled by simple global states provided through custom hooks built on useState and useContext.
Tests are broken... :/ The problem seems to come from enzyme-mounting components that use hooks.