NavigationContainer: initialRouteName: Issue with TypeScript
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 42/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- react-native, typescript
- Lĩnh vực
- documentation, mobile-dev
Hướng nghiên cứu
Bắt đầu với trang tài liệu Hello React Navigation được liên kết và kiểm tra ví dụ sử dụng NavigationContainer và Stack.Navigator. Tái hiện lỗi TypeScript với các dependency được hiển thị, sau đó cập nhật ví dụ để cấu hình route được ghi trong tài liệu được chấp nhận mà không có lỗi đã nêu.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
Following the documentation provided, I see that there is an issue when setting the property initialRouteName to the NavigationContainer tag.
Computer: Mac OS 14.1 (23B74)
Editor: VSCode using React Native Tools by Microsoft.
Description
package.json dependencies:
"dependencies": {
"@react-navigation/native": "^6.1.9",
"@react-navigation/native-stack": "^6.9.17",
"@react-navigation/stack": "^6.3.20",
"react": "18.2.0",
"react-native": "0.72.6",
"react-native-gesture-handler": "^2.13.4",
"react-native-safe-area-context": "^4.7.4",
"react-native-screens": "^3.27.0",
},
App.js:
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
*/
import * as React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import Home from './views/Home'
const Stack = createNativeStackNavigator();
function App(): JSX.Element {
return (
<NavigationContainer initialRouteName="Home">
<Stack.Navigator>
<Stack.Screen name="Home" component={Home} />
</Stack.Navigator>
</NavigationContainer>
);
}
export default App;
VSCode Error Popup:
Type '{ children: Element; initialRouteName: string; }' is not assignable to type 'IntrinsicAttributes & NavigationContainerProps & { theme?: Theme | undefined; linking?: LinkingOptions<RootParamList> | undefined; fallback?: ReactNode; documentTitle?: DocumentTitleOptions | undefined; onReady?: (() => void) | undefined; } & { ...; }'.
Property 'initialRouteName' does not exist on type 'IntrinsicAttributes & NavigationContainerProps & { theme?: Theme | undefined; linking?: LinkingOptions<RootParamList> | undefined; fallback?: ReactNode; documentTitle?: DocumentTitleOptions | undefined; onReady?: (() => void) | undefined; } & { ...; }'.ts(2322)
Screenshot:
Acceptance Criteria
I was expecting no error would show up
- Ngôn ngữ chính
- JavaScript
- Star
- 324
- Fork
- 2k
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của react-navigation/react-navigation.github.io
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 94/100
react-navigation/react-navigation.github.io#1516 · 1 bình luận ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Tất cả issue của react-navigation/react-navigation.github.io
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
avniproject/avni-client#2135 ·
-
automated broken-link
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
-
agent/security hive/hosted-available-lke648397-260827-5n31 security
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
babalae/bettergi-scripts-list#3674 ·
-
A-Release-Notes C-Editing D-Modest S-Ready-For-Implementation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
bevyengine/bevy-website#2595 ·