The problem of the new React Native
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- react-native
- Lĩnh vực
- mobile-dev
Hướng nghiên cứu
Bắt đầu từ entry point useCopilot().start và theo dõi cách scrollViewRef được cung cấp đi tới ref.measureLayout khi chạy SettingsScreenMock được cung cấp trên React Native 0.79.6 với Fabric. Tái hiện lỗi tự động cuộn khi chuyển đổi giữa các bước, sau đó xác minh rằng các chuyển tiếp của tutorial cuộn đến từng component walkthroughable mà không gặp lỗi native-ref.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Current Behavior
auto scroll doesn't work when switching between blocks - ref.measureLayout must be called with a ref to a native component.
import React, { useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { ScrollView, Text, TouchableOpacity, View, SafeAreaView, RefreshControl } from 'react-native';
import { CopilotProvider, CopilotStep, useCopilot, walkthroughable } from 'react-native-copilot';
import getCopilotLabel from '../../../../src/utils/helpers/getCopilotLabel';
import styles from './styles';
const WalkthroughableTouchableOpacity = walkthroughable(TouchableOpacity);
const mockSettingsData = [
{ id: '1', title: 'Wi-Fi Settings', type: 'setting' },
{ id: '2', title: 'Notification Settings', type: 'setting' },
{ id: '3', title: 'Sound Settings', type: 'setting' },
{ id: '4', title: 'Display Settings', type: 'setting' },
{ id: '5', title: 'Privacy Settings', type: 'setting' },
{ id: '7', title: 'Delete Device', type: 'danger' },
{ id: '8', title: 'Sound Settings', type: 'setting' },
{ id: '9', title: 'Display Settings', type: 'setting' },
{ id: '10', title: 'Privacy Settings', type: 'setting' },
{ id: '11', title: 'Delete Device', type: 'danger' },
{ id: '12', title: 'Sound Settings', type: 'setting' },
{ id: '13', title: 'Sound Settings', type: 'setting' },
{ id: '14', title: 'Display Settings', type: 'setting' },
{ id: '15', title: 'Privacy Settings', type: 'setting' },
{ id: '16', title: 'Delete Device', type: 'danger' },
{ id: '17', title: 'Sound Settings', type: 'setting' },
{ id: '18', title: 'Display Settings', type: 'setting' },
{ id: '19', title: 'Privacy Settings', type: 'setting' },
{ id: '20', title: 'Delete Device', type: 'danger' },
];
const SettingsScreenMock = () => {
const { start } = useCopilot();
const scrollViewRef = useRef(null);
const [refreshing, setRefreshing] = useState(false);
const onRefresh = () => {
setRefreshing(true);
setTimeout(() => setRefreshing(false), 1000);
};
const startTutorial = () => {
start(false, scrollViewRef.current);
};
return (
<SafeAreaView style={{ flex: 1 }}>
<View style={{ padding: 16 }}>
<TouchableOpacity onPress={startTutorial} style={{ padding: 10, backgroundColor: '#007AFF', borderRadius: 8, marginBottom: 16 }}>
<Text style={{ color: 'white', textAlign: 'center' }}>Start Tutorial</Text>
</TouchableOpacity>
</View>
<ScrollView ref={scrollViewRef} style={{ flex: 1 }} refreshControl={<RefreshControl refreshing={refreshing} onRefresh={onRefresh} tintColor='#007AFF' />}>
{mockSettingsData.map((item, index) => (
<CopilotStep key={item.id} name={`step-${index}`} order={index} text={`This is step ${index + 1}: ${item.title}`}>
<WalkthroughableTouchableOpacity
style={{
padding: 16,
borderBottomWidth: 1,
marginBottom: 50,
borderBottomColor: '#EEE',
backgroundColor: item.type === 'danger' ? '#FFF0F0' : 'white',
}}
>
<Text style={{ color: item.type === 'danger' ? '#FF3B30' : '#000' }}>{item.title}</Text>
</WalkthroughableTouchableOpacity>
</CopilotStep>
))}
{/* Дополнительные элементы для прокрутки */}
{Array.from({ length: 10 }).map((_, index) => (
<View key={`extra-${index}`} style={{ padding: 20, backgroundColor: index % 2 === 0 ? '#F5F5F5' : 'white' }}>
<Text>Additional item {index + 1}</Text>
</View>
))}
</ScrollView>
</SafeAreaView>
);
};
const SettingsContainer = () => {
const { t } = useTranslation('guides');
const labels = getCopilotLabel(t);
return (
<CopilotProvider tooltipStyle={styles.copilot} stopOnOutsideClick androidStatusBarVisible labels={labels}>
<SettingsScreenMock />
</CopilotProvider>
);
};
export default SettingsContainer;
Environment
- Device: [e.g. iPhone 8 Simulator]
- OS: [e.g. iOS12]
react-native-copilot: 3.3.3
"react-native": "^0.79.6",
"react-native-svg": "15.12.x",
Possible Solution
It is necessary to change the logic of working with the ref, because it changed when connecting Fabric
Additional context/Screenshots
https://github.com/user-attachments/assets/17ae6d94-d22c-4273-b883-e2d36018246f
- Ngôn ngữ chính
- TypeScript
- Star
- 2.4k
- Fork
- 425
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
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 mohebifar/react-native-copilot
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 72/100
mohebifar/react-native-copilot#354 · 1 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
mohebifar/react-native-copilot#351 · 1 bình luận · 1 reaction ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 15/100
mohebifar/react-native-copilot#348 · 2 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
Tất cả issue của mohebifar/react-native-copilot
Issue tương tự
-
[Bug]: RUN_STARTED resets the run's tool-call tally even when a subscriber suppresses the eventĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
ag-ui-protocol/ag-ui#3504 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Dokploy/dokploy#6151 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area/profiles area/sessions comp/desktop desktop/chat desktop/sessions P2 type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
NousResearch/hermes-agent#161712 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug p3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
rothgar/rabble.radio#283 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug from-app needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
nightly-labs/openbot#19805 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày