`flexGrow: 1` inside `alignItems: <non-stretch>` covers siblings
未关闭
还没有人认领这个 Issue。
Component: ScrollView
Issue: Author Provided Repro
Needs: Triage :mag:
Newer Patch Available
- 主要语言
- C++
- 星标
- 127k
- 派生
- 25.3k
- 平均合并
- 1 天 23 小时
- 30 天内合并 PR
- 4
描述
Description
Android:
React Native Version
0.72.5
Output of npx react-native info
> npx react-native info
info Fetching system and libraries information...
System:
OS: Windows 10 10.0.22621
CPU: "(12) x64 AMD Ryzen 5 5600 6-Core Processor "
Memory: 16.28 GB / 31.91 GB
Binaries:
Node:
version: 20.2.0
path: C:\Program Files\nodejs\node.EXE
Yarn: Not Found
npm:
version: 9.7.2
path: C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK: Not Found
Windows SDK: Not Found
IDEs:
Android Studio: Not Found
Visual Studio:
- 17.5.33424.131 (Visual Studio Community 2022)
Languages:
Java:
version: 11.0.20.1
path: C:\Program Files\Eclipse Adoptium\jdk-11.0.20.101-hotspot\bin\javac.EXE
Ruby: Not Found
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.72.5
wanted: 0.72.5
react-native-windows: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: true
iOS:
hermesEnabled: Not found
newArchEnabled: Not found
Steps to reproduce
import { View, Text } from 'react-native';
export default function App() {
return (
<View>
<View style={{ alignItems: 'center', }}>
<View style={{ backgroundColor: 'red' }}>
<View style={{ flexGrow: 1 }}>
<Text>foo</Text>
</View>
</View>
<Text>foo</Text>
<Text>foo</Text>
<Text>foo</Text>
<Text>foo</Text>
</View>
</View>
);
}
Snack, screenshot, or link to a repository
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先,使用报告中的 React Native 0.72.5 配置复现链接的 Expo Snack 中的布局,重点关注 alignItems 被设置为非 stretch 值以及嵌套的 flexGrow view。将 Android 渲染结果与预期的兄弟布局进行比较;完成的标准是 flexGrow 子元素不再覆盖其兄弟元素。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript, react-native
- 领域
- mobile
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100