`@effect/ui-native` (Effect-TS/ui): `scroll` `ViewKind` forwards string `decelerationRate` (`"fast"` / `"normal"`) unconverted to Fabric `RCTScrollView`
维护者通常 1 天内回复
@effect-bot 已经在做这个了。
开始于 2026年11月29日。
评估
这个 Issue 还没有评估数据。
描述
partially generated with help of my ai friend - neon 4.4
Hi effect team,
I was trying out this package and wanted to report some bugs encountered while porting a library to effect native
What version of Effect is running?
effect:4.1.7@effect/ui&@effect/ui-native:Effect-TS/uimainat77391ee50ae3d3175d670facbf675e9a819ba6a6react-native:0.88.1
What steps can reproduce the bug?
- Clone the minimal reproduction repository:
git clone https://github.com/cliffordfajardo/effectui-native-error-reproductions.git cd effectui-native-error-reproductions pnpm install pnpm vitest run 04-scroll-deceleration-rate-string-not-converted - Create a
scrollelement and set React Native's standard string presetdecelerationRate: "fast"(or"normal"), e.g. for a snap-to-interval picker or carousel:
const scroll = host.createElement("scroll")
host.setProp(scroll, "decelerationRate", "fast")
host.insertBefore(root, scroll, undefined)
host.commit?.()
- Inspect the props passed to Fabric
RCTScrollViewviaui.createNode/ui.cloneNodeWithNewProps(see04-scroll-deceleration-rate-string-not-converted/repro.test.ts).
What is the expected behavior?
Just like React Native's processDecelerationRate, setting decelerationRate to "fast" or "normal" on a scroll element should convert the string preset to the platform float expected by Fabric RCTScrollView:
- iOS:
"fast"->0.99,"normal"->0.998 - Android:
"fast"->0.9,"normal"->0.985
(And numeric values should continue to pass through unchanged.)
What do you see instead?
In packages/ui-native/src/internal/kinds.ts:68-91, the scroll ViewKind defines setters for horizontal, contentContainerStyle, and scrollEnabled, but has no setter for decelerationRate. As a result, "fast" / "normal" is forwarded raw as a string into Fabric RCTScrollView's props instead of a float.
Additionally, ScrollElement (packages/ui-native/src/Native.ts:1560-1624) does not yet expose typed prop helpers (or a ScrollProps interface) for common Fabric scroll props such as snapToInterval, snapToOffsets, decelerationRate, showsVerticalScrollIndicator, showsHorizontalScrollIndicator, bounces, and pagingEnabled.
Additional information
Possible fix in packages/ui-native/src/internal/kinds.ts:
decelerationRate(n, value, host) {
const rate =
value === "fast"
? host.os === "ios" ? 0.99 : 0.9
: value === "normal"
? host.os === "ios" ? 0.998 : 0.985
: value
host.set(n, "decelerationRate", rate)
}
- 主要语言
- TypeScript
- 星标
- 16.7k
- 派生
- 808
- 平均合并
- 21 小时 22 分钟
- 30 天内合并 PR
- 486
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Effect-TS/effect 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
`@effect/ui-native` (Effect-TS/ui): `kit/VirtualList` `list` part widens `R` to `any`, poisoning enclosing components可能已有人在做 @effect-bot 今天认领。 未关闭
Effect-TS/effect#11097 · 已指派 1 人 ·
维护者通常 1 天内回复
-
`@effect/ui-native` (Effect-TS/ui): Controlled `input` rejected-edit restore never calls `host.commit()`可能已有人在做 @effect-bot 今天认领。 未关闭
Effect-TS/effect#11096 · 已指派 1 人 ·
维护者通常 1 天内回复
相似的 Issue
-
check:failed streams:edit
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 67/100
维护者通常 1 天内回复
-
[Bug]: Critical path skips a child span that ends exactly when the next one starts可能已有人在做 @Piyush4801 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
jaegertracing/jaeger-ui#4865 · 1 条评论 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 90/100
anthropics/claude-code#112972 ·
-
Type: Improvement
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复