Skip to content

docs(cndocs): remove React.useState/useRef prefix in new-architecture docs#1036

Merged
sunnylqm merged 1 commit into
productionfrom
auto-translate-20260628-batch
Jun 29, 2026
Merged

docs(cndocs): remove React.useState/useRef prefix in new-architecture docs#1036
sunnylqm merged 1 commit into
productionfrom
auto-translate-20260628-batch

Conversation

@sunnylqm

@sunnylqm sunnylqm commented Jun 28, 2026

Copy link
Copy Markdown

Summary

Sync 2 cndocs/ files with upstream — remove React.useState/React.useRef prefix to match the React 17+ JSX transform pattern used upstream.

Translation files changed

File Change
cndocs/the-new-architecture/custom-cxx-types.md React.useStateuseState (5 occurrences)
cndocs/the-new-architecture/layout-measurements.md React.useRefref (1 occurrence)

Website config / deps sync

No cnwebsite/ config or dependency changes needed this batch. Upstream changes since PR #1035 were limited to website/ footer link reorganization and styling tweaks — CN website has its own independent footer structure.

False positives (already synced, no changes needed)

8 stub files (checkbox, clipboard, datepickerandroid, datepickerios, imagepickerios, segmentedcontrolios, statusbarios, timepickerandroid) are already properly translated CN versions of "Removed from React Native" notices. colors.md is also already fully translated — differences are only in translated prose, not structure or code.

Notes

  • These files will still appear in sync-translations.sh output until this PR merges to production, because the script compares upstream timestamps against production.
  • No website/cnwebsite/ config sync needed: upstream's recent docusaurus.config.ts changes (copyright text, footer link reorganization) don't apply to CN's independent footer/branding.

Summary by CodeRabbit

  • Documentation
    • Updated example code in the custom C++ types guide to use direct React hooks and reflect current state handling for the sample app.
    • Expanded the cubic root example so it includes input handling and displays the computed result in the UI.
    • Refined the structured address example code to match the latest hook usage and state setup.
    • Updated the layout measurements guide to use direct useRef hook usage in the sample snippet.

… docs

- custom-cxx-types.md: React.useState → useState (5 occurrences)
- layout-measurements.md: React.useRef → useRef (1 occurrence)

Aligns with upstream React import removal pattern (React 17+ JSX transform).
@netlify

netlify Bot commented Jun 28, 2026

Copy link
Copy Markdown

Deploy Preview for reactnativecn failed. Why did it fail? →

Name Link
🔨 Latest commit 53d847d
🔍 Latest deploy log https://app.netlify.com/projects/reactnativecn/deploys/6a40ff3b1091fc0008f2de7c

@coderabbitai

coderabbitai Bot commented Jun 28, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 24e5d4f1-7da8-4486-90e7-53aaa3edd842

📥 Commits

Reviewing files that changed from the base of the PR and between 055e1af and 53d847d.

📒 Files selected for processing (2)
  • cndocs/the-new-architecture/custom-cxx-types.md
  • cndocs/the-new-architecture/layout-measurements.md

📝 Walkthrough

Walkthrough

Three code snippets in two documentation files replace React.useState(...) with useState(...) and React.useRef(...) with useRef(...), aligning the shown examples with named hook imports.

Changes

Hook namespace updates in doc snippets

Layer / File(s) Summary
useState/useRef namespace change
cndocs/the-new-architecture/custom-cxx-types.md, cndocs/the-new-architecture/layout-measurements.md
State declarations for cubicSource, cubicRoot, street, num, isValidAddress, and targetRef switch from React.useState/React.useRef to named useState/useRef calls in example snippets.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Poem

🐰 No more React.useState today,
Just useState leads the way!
The hooks stand proud, named and free,
In docs as clean as they can be.
A tidy snippet, hip-hop-hooray! 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: removing React.useState/useRef prefixes in the new-architecture docs.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch auto-translate-20260628-batch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sunnylqm sunnylqm merged commit 4485b40 into production Jun 29, 2026
1 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant