The problem of the new React Native
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- react-native
- 領域
- mobile-dev
調査の方向性
エントリーポイント useCopilot().start から開始し、React Native 0.79.6 を Fabric で使用して提供された SettingsScreenMock を実行したときに、渡された scrollViewRef がどのように ref.measureLayout に到達するかを追跡します。ステップ間を切り替えながら自動スクロールの失敗を再現し、その後、チュートリアルの遷移によって native-ref エラーなしに各 walkthroughable コンポーネントまでスクロールされることを確認します。
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- TypeScript
- スター
- 2.4k
- フォーク
- 425
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
mohebifar/react-native-copilot のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
mohebifar/react-native-copilot#354 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
mohebifar/react-native-copilot#351 · コメント 1 件 · リアクション 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 15/100
mohebifar/react-native-copilot#348 · コメント 2 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
mohebifar/react-native-copilot の issue をすべて見る
似ている issue
-
[Bug]: RUN_STARTED resets the run's tool-call tally even when a subscriber suppresses the eventオープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
ag-ui-protocol/ag-ui#3504 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Dokploy/dokploy#6151 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
area/profiles area/sessions comp/desktop desktop/chat desktop/sessions P2 type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
NousResearch/hermes-agent#161712 ·
メンテナーはふだん 1 日以内に返信
-
bug p3
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
rothgar/rabble.radio#283 ·
メンテナーはふだん 1 日以内に返信
-
bug from-app needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
nightly-labs/openbot#19805 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信