[help]How to use TypeScript to define the type of a routing stack array? #11542
Replies: 3 comments
-
Hey @wanxue0804! Thanks for opening the issue. It seems that the issue doesn't contain a link to a repro. The best way to get attention to your issue is to provide an easy way for a developer to reproduce the issue. You can provide a repro using any of the following:
A snack link is preferred since it's the easiest way to both create and share a repro. If it's not possible to create a repro using a snack, link to a GitHub repo under your username is a good alternative. Don't link to a branch or specific file etc. as it won't be detected. Try to keep the repro as small as possible by narrowing down the minimal amount of code needed to reproduce the issue. Don't link to your entire project or a project containing code unrelated to the issue. See "How to create a Minimal, Reproducible Example" for more information. You can edit your original issue to include a link to the repro, or leave it as a comment. The issue will be closed automatically after a while if you don't provide a repro. |
Beta Was this translation helpful? Give feedback.
-
The versions mentioned in the issue for the following packages differ from the latest versions on npm:
Can you verify that the issue still exists after upgrading to the latest versions of these packages? |
Beta Was this translation helpful? Give feedback.
-
Couldn't find version numbers for the following packages in the issue:
Can you update the issue to include version numbers for those packages? The version numbers must match the format 1.2.3. The versions mentioned in the issue for the following packages differ from the latest versions on npm:
Can you verify that the issue still exists after upgrading to the latest versions of these packages? |
Beta Was this translation helpful? Give feedback.
-
Current behavior
I want to extract
stackRoutes
into an array, now my code is as follows,When I try to use props in the Profile page, the Profile component in stackRoutes displays an error message.
If I don’t use props, no error will be reported.
Due to business requirements,
stackRoutes
must be extracted into an array, and the attribute reminder of routeConfig is required when adding an itemWhen the current writing method adds stackRoutes, all attributes are prompted, but the component will report an error here, and the parameter prompt is also wrong when the navigation.navigate(routeName) of the page
I want to know how can I modify the type definition of
stackRoutes
so as not to report an error, please help me, it is urgentExpected behavior
When I add items to
stackRoutes
, there will be prompts for attributes such as name and component, and the attributes in options can be prompted, and the page can also use route, navigation and other parameters normally.Reproduction
https://snack.expo.dev/wPNH-AqjY
Platform
Packages
Environment
Beta Was this translation helpful? Give feedback.
All reactions