docs(cndocs): 同步翻译更新 2026-02-21(高质量)#1002
Conversation
❌ Deploy Preview for reactnativecn failed. Why did it fail? →
|
📝 WalkthroughWalkthroughThis pull request updates React Native Chinese documentation across eleven files, migrating code examples from HTML to JSX style markup, introducing tabbed code samples for JavaScript and TypeScript variants, wrapping SafeArea components in examples, and restructuring guide organization with localized content and enhanced prop documentation. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 7
🧹 Nitpick comments (3)
scripts/translate-progress.json (1)
13-22: Consider sorting new entries alphabetically.The existing
mergedentries are in alphabetical order (accessibility → build-speed → building-for-tv), but the newly appended entries (global-performance,running-on-simulator-ios,hermes, etc.) break the sort. If any tooling iterates this list expecting sorted order, this could cause issues.🔀 Suggested alphabetical placement
"cndocs/build-speed.md", "cndocs/building-for-tv.md", + "cndocs/debugging-native-code.md", + "cndocs/global-PerformanceObserver.md", + "cndocs/global-performance.md", + "cndocs/hermes.md", + "cndocs/improvingux.md", + "cndocs/react-native-devtools.md", + "cndocs/running-on-simulator-ios.md", + "cndocs/shadow-props.md", + "cndocs/statusbar.md", + "cndocs/touchablewithoutfeedback.md" - "cndocs/global-performance.md", - "cndocs/global-PerformanceObserver.md", - "cndocs/running-on-simulator-ios.md", - "cndocs/react-native-devtools.md", - "cndocs/shadow-props.md", - "cndocs/improvingux.md", - "cndocs/statusbar.md", - "cndocs/debugging-native-code.md", - "cndocs/touchablewithoutfeedback.md", - "cndocs/hermes.md"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@scripts/translate-progress.json` around lines 13 - 22, The list of newly appended entries in the JSON array (the "merged" entries) is not alphabetized and breaks the existing alphabetical order; sort the entries in that array alphabetically (e.g., ensure "cndocs/global-performance.md", "cndocs/global-PerformanceObserver.md", "cndocs/hermes.md", "cndocs/improvingux.md", "cndocs/debugging-native-code.md", "cndocs/running-on-simulator-ios.md", "cndocs/react-native-devtools.md", "cndocs/shadow-props.md", "cndocs/statusbar.md", "cndocs/touchablewithoutfeedback.md", "cndocs/building-for-tv.md" etc. are placed in correct lexicographic order) so any tooling that iterates the "merged" array sees items in sorted order.cndocs/drawerlayoutandroid.md (1)
88-163: TypeScript example is missingSafeAreaProvider/SafeAreaViewwrapping present in the JavaScript example.The JS tab wraps the content in
SafeAreaProvider→SafeAreaView(fromreact-native-safe-area-context), but the TS tab uses plainView. This produces visually different results on devices with notches/insets, and confuses readers comparing the two variants.♻️ Proposed fix — align TS example with JS example
import { Button, DrawerLayoutAndroid, Text, StyleSheet, - View, } from 'react-native'; +import {SafeAreaView, SafeAreaProvider} from 'react-native-safe-area-context'; ... const navigationView = () => ( - <View style={[styles.container, styles.navigationContainer]}> + <SafeAreaView style={[styles.container, styles.navigationContainer]}> <Text style={styles.paragraph}>I'm in the Drawer!</Text> <Button title="Close drawer" onPress={() => drawer.current?.closeDrawer()} /> - </View> + </SafeAreaView> ); return ( - <DrawerLayoutAndroid + <SafeAreaProvider> + <DrawerLayoutAndroid ref={drawer} drawerWidth={300} drawerPosition={drawerPosition} renderNavigationView={navigationView}> - <View style={styles.container}> + <SafeAreaView style={styles.container}> ... - </View> + </SafeAreaView> </DrawerLayoutAndroid> + </SafeAreaProvider> );🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@cndocs/drawerlayoutandroid.md` around lines 88 - 163, The TypeScript example (App, navigationView, and styles) should match the JS example by importing SafeAreaProvider and SafeAreaView from react-native-safe-area-context and wrapping the component tree accordingly: add imports for SafeAreaProvider and SafeAreaView, wrap the entire returned DrawerLayoutAndroid in <SafeAreaProvider> and replace the root <View> used inside DrawerLayoutAndroid and the navigationView's root <View> with <SafeAreaView> so insets/notches are handled the same as the JS example while keeping types for drawer and state unchanged.cndocs/state.md (1)
24-30:useEffect缺少依赖数组,每次渲染都会重建 interval当前写法(无
[])在每次渲染后都会清除旧的 interval 并创建新的,导致不必要的开销。由于!isShowingText是对闭包中捕获值的取反,此示例仍可正常运行,但对于文档读者而言不是最佳示范。更惯用的写法是使用函数式更新 + 空依赖数组(TS 示例的同位置逻辑相同):
♻️ Suggested improvement (JS and TS tabs)
useEffect(() => { const toggle = setInterval(() => { - setIsShowingText(!isShowingText); + setIsShowingText(prev => !prev); - }, 1000); + }, 1000); return () => clearInterval(toggle); - }); + }, []);🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@cndocs/state.md` around lines 24 - 30, useEffect is recreating the interval on every render because it lacks a dependency array; change the effect to run once by adding an empty dependency array and switch to a functional state updater to avoid capturing stale isShowingText (use setIsShowingText(prev => !prev)), keeping the existing cleanup that calls clearInterval on the interval identifier (toggle) so the interval is created once and properly cleared.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@cndocs/components-and-apis.md`:
- Line 15: Update the broken anchor in cndocs/components-and-apis.md by
replacing the English fragment "libraries#finding-libraries" with the Chinese
fragment "#搜索第三方库" so the link points to the correct section in
cndocs/libraries.md; ensure the markdown link target matches exactly "#搜索第三方库"
to restore proper navigation.
In `@cndocs/layout-props.md`:
- Line 562: The link text "MDN CSS Reference" is misleading because the URL
points to Yoga Layout docs; update the link in the line containing "See [MDN CSS
Reference](https://www.yogalayout.dev/docs/styling/layout-direction)" so text
and target match: either change the link text to something like "Yoga Layout
docs" (or "Yoga layout reference") to keep the existing URL, or replace the URL
with the appropriate MDN page (e.g., the relevant CSS property reference) so the
text "MDN CSS Reference" remains accurate; ensure the link label and destination
are consistent.
In `@cndocs/running-on-device.md`:
- Line 385: Replace the empty alt attributes on the image markdown lines (e.g.,
"" and the other occurrences
noted) with meaningful, concise alt text describing each image (for example:
"Code signing settings in Xcode" or similar for each specific image) so screen
readers can convey the content; update all four instances referenced (the
current image lines at the shown occurrences) ensuring each alt string
succinctly reflects the image content.
- Around line 48-50: The current note that suggests running `adb reverse
tcp:8081 tcp:8081` when `unauthorized` appears is misleading; replace that note
text (the block mentioning `unauthorized` and `adb reverse tcp:8081 tcp:8081`)
with guidance that an `unauthorized` entry means the host RSA key isn't approved
on the device and cannot be fixed with `adb reverse`, and instruct readers to
disconnect/reconnect the USB cable and accept the "Allow USB debugging" prompt
(or revoke & reauthorize host keys in device Developer Options) to authorize the
computer before using `adb reverse`.
In `@cndocs/signed-apk-android.md`:
- Around line 59-64: The fenced code block containing the environment properties
(lines with MYAPP_UPLOAD_STORE_FILE, MYAPP_UPLOAD_KEY_ALIAS,
MYAPP_UPLOAD_STORE_PASSWORD, MYAPP_UPLOAD_KEY_PASSWORD) is missing a language
specifier; update the opening triple-backtick to include an appropriate language
tag (e.g., ini or dotenv) so markdownlint MD040 is satisfied and syntax
highlighting works, ensuring the block still contains the same lines and values.
In `@cndocs/state.md`:
- Line 12: 将文中短语“快速的显隐切换”中的“快速的”改为副词形式“快速地”,即把“快速的显隐切换”替换为“快速地显隐切换”;在
cndocs/state.md 中查找该短语并做该单词替换以修正语法。
In `@cndocs/touchablenativefeedback.md`:
- Around line 47-51: The helper randomHexColor currently uses
Math.round(Math.random() * 16) which can produce 16 and emit two-character hex
chunks; change the random integer generation to produce values in 0–15 (e.g.,
use Math.floor(Math.random() * 16) or equivalent) so each replace call yields a
single hex digit and the resulting string from randomHexColor stays a valid
7-character CSS hex color; update the function randomHexColor accordingly.
---
Nitpick comments:
In `@cndocs/drawerlayoutandroid.md`:
- Around line 88-163: The TypeScript example (App, navigationView, and styles)
should match the JS example by importing SafeAreaProvider and SafeAreaView from
react-native-safe-area-context and wrapping the component tree accordingly: add
imports for SafeAreaProvider and SafeAreaView, wrap the entire returned
DrawerLayoutAndroid in <SafeAreaProvider> and replace the root <View> used
inside DrawerLayoutAndroid and the navigationView's root <View> with
<SafeAreaView> so insets/notches are handled the same as the JS example while
keeping types for drawer and state unchanged.
In `@cndocs/state.md`:
- Around line 24-30: useEffect is recreating the interval on every render
because it lacks a dependency array; change the effect to run once by adding an
empty dependency array and switch to a functional state updater to avoid
capturing stale isShowingText (use setIsShowingText(prev => !prev)), keeping the
existing cleanup that calls clearInterval on the interval identifier (toggle) so
the interval is created once and properly cleared.
In `@scripts/translate-progress.json`:
- Around line 13-22: The list of newly appended entries in the JSON array (the
"merged" entries) is not alphabetized and breaks the existing alphabetical
order; sort the entries in that array alphabetically (e.g., ensure
"cndocs/global-performance.md", "cndocs/global-PerformanceObserver.md",
"cndocs/hermes.md", "cndocs/improvingux.md", "cndocs/debugging-native-code.md",
"cndocs/running-on-simulator-ios.md", "cndocs/react-native-devtools.md",
"cndocs/shadow-props.md", "cndocs/statusbar.md",
"cndocs/touchablewithoutfeedback.md", "cndocs/building-for-tv.md" etc. are
placed in correct lexicographic order) so any tooling that iterates the "merged"
array sees items in sorted order.
| - [其他](components-and-apis#其他) | ||
|
|
||
| 需要说明的是,你不会被局限在这些内置组件上。React Native 是大开源社区的作品,所以你还可以在 github 或是 npm 上搜索到带有`react native`关键字的大量的第三方组件。 | ||
| 需要说明的是,你不会被局限在这些内置组件上。React Native 有一个由数千名开发者组成的庞大社区。如果你正在寻找某个特定功能的库,请参阅[查找第三方库](libraries#finding-libraries)的指南。 |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check if cndocs/libraries.md exists and find the relevant section heading
echo "=== Checking cndocs/libraries.md for section headings ==="
if [ -f "cndocs/libraries.md" ]; then
# Search for headings related to finding/searching libraries
rg -n "^##\s+" cndocs/libraries.md | head -20
echo ""
echo "=== Searching for specific patterns ==="
rg -n "finding.libraries|Finding Libraries|搜索第三方库" cndocs/libraries.md
else
echo "File cndocs/libraries.md not found"
fi
echo ""
echo "=== Checking cndocs/components-and-apis.md for the link ==="
if [ -f "cndocs/components-and-apis.md" ]; then
# Show line 15 and surrounding context
sed -n '10,20p' cndocs/components-and-apis.md
else
echo "File cndocs/components-and-apis.md not found"
fiRepository: reactnativecn/react-native-website
Length of output: 665
Fix broken anchor reference in Chinese docs
The link libraries#finding-libraries uses an English fragment that doesn't exist in the Chinese libraries.md file. The correct Chinese anchor is #搜索第三方库 (line 96 in cndocs/libraries.md).
Replace with:
-请参阅[查找第三方库](libraries#finding-libraries)的指南
+请参阅[查找第三方库](libraries#搜索第三方库)的指南📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| 需要说明的是,你不会被局限在这些内置组件上。React Native 有一个由数千名开发者组成的庞大社区。如果你正在寻找某个特定功能的库,请参阅[查找第三方库](libraries#finding-libraries)的指南。 | |
| 需要说明的是,你不会被局限在这些内置组件上。React Native 有一个由数千名开发者组成的庞大社区。如果你正在寻找某个特定功能的库,请参阅[查找第三方库](libraries#搜索第三方库)的指南。 |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@cndocs/components-and-apis.md` at line 15, Update the broken anchor in
cndocs/components-and-apis.md by replacing the English fragment
"libraries#finding-libraries" with the Chinese fragment "#搜索第三方库" so the link
points to the correct section in cndocs/libraries.md; ensure the markdown link
target matches exactly "#搜索第三方库" to restore proper navigation.
| `direction`指定了用户界面的阅读顺序。`ltr`表示 left to right,即从左往右阅读。反之`rtl`为从右往左阅读。默认值为`inherit`,但根节点的值会根据用户所在地的不同而不同。访问 https://yogalayout.com/docs/layout-direction 来进一步了解。 | ||
| `direction` specifies the directional flow of the user interface. The default is `inherit`, except for root node which will have value based on the current locale. | ||
|
|
||
| See [MDN CSS Reference](https://www.yogalayout.dev/docs/styling/layout-direction) for more details. |
There was a problem hiding this comment.
Link text says "MDN CSS Reference" but URL points to yogalayout.dev.
The link destination https://www.yogalayout.dev/docs/styling/layout-direction is the Yoga layout engine docs, not MDN. Either update the link text or replace the URL.
✏️ Proposed fix
-See [MDN CSS Reference](https://www.yogalayout.dev/docs/styling/layout-direction) for more details.
+See [Yoga Layout documentation](https://www.yogalayout.dev/docs/styling/layout-direction) for more details.📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| See [MDN CSS Reference](https://www.yogalayout.dev/docs/styling/layout-direction) for more details. | |
| See [Yoga Layout documentation](https://www.yogalayout.dev/docs/styling/layout-direction) for more details. |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@cndocs/layout-props.md` at line 562, The link text "MDN CSS Reference" is
misleading because the URL points to Yoga Layout docs; update the link in the
line containing "See [MDN CSS
Reference](https://www.yogalayout.dev/docs/styling/layout-direction)" so text
and target match: either change the link text to something like "Yoga Layout
docs" (or "Yoga layout reference") to keep the existing URL, or replace the URL
with the appropriate MDN page (e.g., the relevant CSS property reference) so the
text "MDN CSS Reference" remains accurate; ensure the link label and destination
are consistent.
| :::note | ||
| 如果你在列表中看到 `unauthorized`,需要运行 `adb reverse tcp:8081 tcp:8081` 并在设备上允许 USB 调试。 | ||
| ::: |
There was a problem hiding this comment.
Misleading guidance for unauthorized ADB state.
An unauthorized device in adb devices means the computer's RSA key hasn't been approved on the device yet — adb reverse requires an already-authorized connection, so it won't resolve this state. The real fix is to disconnect/reconnect the USB cable and Allow the USB debugging prompt on the device.
Consider rewording to:
-如果你在列表中看到 `unauthorized`,需要运行 `adb reverse tcp:8081 tcp:8081` 并在设备上允许 USB 调试。
+如果你在列表中看到 `unauthorized`,请断开并重新连接 USB 数据线,然后在设备上的弹窗中允许 USB 调试。📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| :::note | |
| 如果你在列表中看到 `unauthorized`,需要运行 `adb reverse tcp:8081 tcp:8081` 并在设备上允许 USB 调试。 | |
| ::: | |
| :::note | |
| 如果你在列表中看到 `unauthorized`,请断开并重新连接 USB 数据线,然后在设备上的弹窗中允许 USB 调试。 | |
| ::: |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@cndocs/running-on-device.md` around lines 48 - 50, The current note that
suggests running `adb reverse tcp:8081 tcp:8081` when `unauthorized` appears is
misleading; replace that note text (the block mentioning `unauthorized` and `adb
reverse tcp:8081 tcp:8081`) with guidance that an `unauthorized` entry means the
host RSA key isn't approved on the device and cannot be fixed with `adb
reverse`, and instruct readers to disconnect/reconnect the USB cable and accept
the "Allow USB debugging" prompt (or revoke & reauthorize host keys in device
Developer Options) to authorize the computer before using `adb reverse`.
| 在 Xcode Project 导航中选择你的 project,然后选择 main target(它应该和 project 同名)。查找"General"标签,前往"Signing"并确保在"Team"下拉菜单下选择了你的 Apple 开发者账号或团队。对 tests target(名称以 Tests 结尾,在 main target 下面)也**重复**同样的操作。 | ||
|
|
||
|  | ||
|  |
There was a problem hiding this comment.
Images are missing alt text — accessibility issue (MD045).
All four image references have empty alt text, which breaks screen reader navigation.
♿ Proposed fix
-
+
-
+
-
+
-
+Also applies to: 391-391, 401-401, 425-425
🧰 Tools
🪛 markdownlint-cli2 (0.21.0)
[warning] 385-385: Images should have alternate text (alt text)
(MD045, no-alt-text)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@cndocs/running-on-device.md` at line 385, Replace the empty alt attributes on
the image markdown lines (e.g.,
"" and the other occurrences
noted) with meaningful, concise alt text describing each image (for example:
"Code signing settings in Xcode" or similar for each specific image) so screen
readers can convey the content; update all four instances referenced (the
current image lines at the shown occurrences) ensuring each alt string
succinctly reflects the image content.
| ``` | ||
| MYAPP_RELEASE_STORE_FILE=my-release-key.keystore | ||
| MYAPP_RELEASE_KEY_ALIAS=my-key-alias | ||
| MYAPP_RELEASE_STORE_PASSWORD=***** | ||
| MYAPP_RELEASE_KEY_PASSWORD=***** | ||
| MYAPP_UPLOAD_STORE_FILE=my-upload-key.keystore | ||
| MYAPP_UPLOAD_KEY_ALIAS=my-key-alias | ||
| MYAPP_UPLOAD_STORE_PASSWORD=***** | ||
| MYAPP_UPLOAD_KEY_PASSWORD=***** | ||
| ``` |
There was a problem hiding this comment.
Fenced code block is missing a language specifier (MD040).
The properties snippet has no language tag, causing a markdownlint warning and degraded syntax highlighting.
🔧 Proposed fix
-```
+```ini
MYAPP_UPLOAD_STORE_FILE=my-upload-key.keystore
MYAPP_UPLOAD_KEY_ALIAS=my-key-alias
MYAPP_UPLOAD_STORE_PASSWORD=*****
MYAPP_UPLOAD_KEY_PASSWORD=*****</details>
<!-- suggestion_start -->
<details>
<summary>📝 Committable suggestion</summary>
> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
```suggestion
🧰 Tools
🪛 markdownlint-cli2 (0.21.0)
[warning] 59-59: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@cndocs/signed-apk-android.md` around lines 59 - 64, The fenced code block
containing the environment properties (lines with MYAPP_UPLOAD_STORE_FILE,
MYAPP_UPLOAD_KEY_ALIAS, MYAPP_UPLOAD_STORE_PASSWORD, MYAPP_UPLOAD_KEY_PASSWORD)
is missing a language specifier; update the opening triple-backtick to include
an appropriate language tag (e.g., ini or dotenv) so markdownlint MD040 is
satisfied and syntax highlighting works, ensuring the block still contains the
same lines and values.
|
|
||
| 一般来说,你需要在构造函数中初始化`state`,然后在需要修改时调用`setState`。 | ||
|
|
||
| 假如我们需要制作一段不停闪烁的文字。文字内容本身在组件创建时就已经指定好了,所以文字内容应该是一个`prop`。而文字的显示或隐藏的状态(快速的显隐切换就产生了闪烁的效果)则是随着时间变化的,因此这一状态应该写到`state`中。 |
There was a problem hiding this comment.
Minor grammar correction: "快速的" → "快速地"
"快速的显隐切换" 中"快速"修饰动词性短语"显隐切换",副词修饰动词应使用"地"而非"的"。
✏️ Proposed fix
-而文字的显示或隐藏的状态(快速的显隐切换就产生了闪烁的效果)
+而文字的显示或隐藏的状态(快速地显隐切换就产生了闪烁的效果)🧰 Tools
🪛 LanguageTool
[uncategorized] ~12-~12: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:快速"地"显
Context: ...已经指定好了,所以文字内容应该是一个prop。而文字的显示或隐藏的状态(快速的显隐切换就产生了闪烁的效果)则是随着时间变化的,因此这一状态应该写到`state...
(wb4)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@cndocs/state.md` at line 12,
将文中短语“快速的显隐切换”中的“快速的”改为副词形式“快速地”,即把“快速的显隐切换”替换为“快速地显隐切换”;在 cndocs/state.md
中查找该短语并做该单词替换以修正语法。
| const randomHexColor = () => { | ||
| return '#000000'.replace(/0/g, function () { | ||
| return Math.round(Math.random() * 16).toString(16); | ||
| }); | ||
| }; |
There was a problem hiding this comment.
Math.round(Math.random() * 16) can produce 16 → invalid hex color.
Math.random() * 16 is in [0, 16). Math.round maps values in [15.5, 16) to 16, and (16).toString(16) returns "10" (two characters). Since the regex replaces each '0' in '#000000' individually, a two-character replacement grows the string beyond 7 characters (e.g. #10a4b2c1), producing an invalid CSS color. This affects roughly 17% of calls (6 digits × ~3.1% each).
The companion function in layout-props.md uses * 14 (max value 14 = "e") which is safe; aligning here would fix the issue.
🐛 Proposed fix
const randomHexColor = () => {
return '#000000'.replace(/0/g, function () {
- return Math.round(Math.random() * 16).toString(16);
+ return Math.floor(Math.random() * 16).toString(16);
});
};📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const randomHexColor = () => { | |
| return '#000000'.replace(/0/g, function () { | |
| return Math.round(Math.random() * 16).toString(16); | |
| }); | |
| }; | |
| const randomHexColor = () => { | |
| return '#000000'.replace(/0/g, function () { | |
| return Math.floor(Math.random() * 16).toString(16); | |
| }); | |
| }; |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@cndocs/touchablenativefeedback.md` around lines 47 - 51, The helper
randomHexColor currently uses Math.round(Math.random() * 16) which can produce
16 and emit two-character hex chunks; change the random integer generation to
produce values in 0–15 (e.g., use Math.floor(Math.random() * 16) or equivalent)
so each replace call yields a single hex digit and the resulting string from
randomHexColor stays a valid 7-character CSS hex color; update the function
randomHexColor accordingly.
翻译同步更新
处理文件(10 个)
跳过
剩余
约 17 个文件存在显著差异。
Summary by CodeRabbit