Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gaohuaxue-mobile-app
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yuxingming
gaohuaxue-mobile-app
Commits
a59d8bcc
Commit
a59d8bcc
authored
Nov 21, 2022
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: 调整路由类型声明
parent
bf96bbba
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
routers.ts
src/routers/routers.ts
+1
-1
types.ts
src/routers/types.ts
+3
-2
index.tsx
src/views/Test/TestDetailsScreen/index.tsx
+1
-2
No files found.
src/routers/routers.ts
View file @
a59d8bcc
...
...
@@ -2,7 +2,7 @@ import BottomTabs from './BottomTabs';
import
TestDetailsScreen
from
'../views/Test/TestDetailsScreen'
;
export
const
ROUTERS
=
{
Home
:
{
BottomTabs
:
{
title
:
'首页'
,
component
:
BottomTabs
,
},
...
...
src/routers/types.ts
View file @
a59d8bcc
...
...
@@ -12,7 +12,7 @@ export type TabRouteType = React.ComponentProps<typeof Tab.Screen>;
export
type
StackRouteType
=
React
.
ComponentProps
<
typeof
Stack
.
Screen
>
;
export
type
RootStackParamList
=
{
Home
:
{
post
:
string
},
BottomTabs
:
NavigatorScreenParams
<
RootTabParamList
>
;
TestDetailsScreen
:
undefined
;
};
...
...
@@ -20,7 +20,8 @@ export type RootStackScreenProps<Screen extends keyof RootStackParamList> =
NativeStackScreenProps
<
RootStackParamList
,
Screen
>
;
export
type
RootTabParamList
=
{
Home
:
NavigatorScreenParams
<
RootStackParamList
>
;
// Home: NavigatorScreenParams<RootStackParamList>;
Home
:
{
post
:
string
};
Customer
:
undefined
;
PWAS
:
undefined
;
PersonalCenter
:
undefined
;
...
...
src/views/Test/TestDetailsScreen/index.tsx
View file @
a59d8bcc
...
...
@@ -12,10 +12,9 @@ const TestDetailsScreen: React.FC<TestDetailsScreenNavigationProp> = ({ navigati
title=
"Go back"
onPress=
{
()
=>
{
// Pass and merge params back to home screen
navigation
.
navigate
(
'
Home
'
,
{
navigation
.
navigate
(
'
BottomTabs
'
,
{
screen
:
'Home'
,
params
:
{
post
:
'postText'
},
merge
:
true
,
});
}
}
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment