When working with Expo and TypeScript, I often use paths like this:
const [HomePath , SettingsPath, ProfilePath] = [
"/",
"/settings",
"/profile",
];
router.push(HomePath);
Recently, I encountered the following error:
"Argument of type 'string' is not assignable to parameter of type 'Href<string | object>'",
I attempted a solution by defining HomePath as follows:
const HomePath : Href<string | object> = '/';
While this fixed the type error, it feels a bit convoluted. Is there a simpler way to address this issue? Any suggestions would be greatly appreciated! Thanks!