Enroute Again
Expo router —— please how do I write from onboarding to invite
Whenever I do router.push() the path intellisense doesnt show me any file named invite despite creating itYou don’t have any index routes inside invite naUnrelated but please don't do this. It makes the code hard to read and whoever is going to maintain it will have such a hard time reading and refactoring your code.
I suggest you abstract the onPress
functionality into its own function and pass the function in the button. might want to wrap it in a useCallback for performance sake.
you might as well assign the dynamic labels to variables wrapped in a memo and pass them into the component.
That way you separate your logic from the UI making it less clunky and readable. Happy coding broClose the dev server, delete the .expo folder, restart ur dev serverAnything else will be ignoredPlease o don’t use useCallback just to prematurely optimize. Only use it for functions that are expensive to call for every render.
Measure, then optimizeYou will sooner run yourself into an out of memory exception because you want to optimizeWhen you memoize you are trading memory for compute… so be aware what you are doingI get your point but way too many edge cases for making this decision but so I’ll advise devs get used to itI’ve refactored way too many codebases where memoizing has been completely disregarded.
To each his own I guessI noticed this in a project I did recently, I memorized the data, works fine on iOS, but on android the screen freezes for 1 second or so