Title: chore(rules): document render-phase ref-seed choice + no-render-in-render caveat by waleedlatif1 · Pull Request #5333 · simstudioai/sim · GitHub
Open Graph Title: chore(rules): document render-phase ref-seed choice + no-render-in-render caveat by waleedlatif1 · Pull Request #5333 · simstudioai/sim
X Title: chore(rules): document render-phase ref-seed choice + no-render-in-render caveat by waleedlatif1 · Pull Request #5333 · simstudioai/sim
Description: Summary Documents two recurring React pitfalls surfaced during the /w react-doctor cleanup, so future coding agents avoid them. sim-hooks.md: the prevX render-phase idiom now explains that the ref seed decides mount behavior — seed a sentinel (useRef(null)) when the replaced effect did real work on mount, else the mount action is silently dropped (this was a real bug we caught). Also clarifies useState→useRef is safe only when the value is never read in render and never a hook dependency. sim-components.md: adds no-render-in-render to the known react-doctor false positives — a helper called inline is reconciled by position and does not remount, so extracting it is usually churn/risk unless mechanical. Type of Change Chore / docs (agent rule files only) Testing Docs-only. Cross-checked against existing rules for contradictions — deliberately did not add notes already covered (e.g. toSorted runtime-polyfill, no-barrel-import, rerender-state-only-in-handlers, absolute-import rules), and dropped a proposed toSorted/lib note that would have been wrong now that apps/sim/tsconfig.json sets lib: ES2023. Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing No new warnings introduced I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)
Open Graph Description: Summary Documents two recurring React pitfalls surfaced during the /w react-doctor cleanup, so future coding agents avoid them. sim-hooks.md: the prevX render-phase idiom now explains that the ref...
X Description: Summary Documents two recurring React pitfalls surfaced during the /w react-doctor cleanup, so future coding agents avoid them. sim-hooks.md: the prevX render-phase idiom now explains that the ref...
Opengraph URL: https://github.com/simstudioai/sim/pull/5333
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:5bacfc8b-aa64-c32d-ddc3-932ceaf5c3ae |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9196:1BD5CA:7FE5D5:B053D9:6AFB467B |
| html-safe-nonce | b3613b448fd011d2e24ac6bd0a0c9e99c4cfda69d0073e48621f29b71680cd46 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MTk2OjFCRDVDQTo3RkU1RDU6QjA1M0Q5OjZBRkI0NjdCIiwidmlzaXRvcl9pZCI6IjU1MTU5OTc2NTkzNDIyNTk4MzUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 9d9f46b22f71bfd8e95e8ee92e7f0f24151538914e4d1f40a32718ded15f8fb9 |
| hovercard-subject-tag | pull_request:3973648372 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/5333/files |
| twitter:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| og:image:alt | Summary Documents two recurring React pitfalls surfaced during the /w react-doctor cleanup, so future coding agents avoid them. sim-hooks.md: the prevX render-phase idiom now explains that the ref... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | d849b928f455c800985398e7f1b659425adb312a5fa14fba5d9a14e62e9fe5dd |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/simstudioai/sim git https://github.com/simstudioai/sim.git |
| octolytics-dimension-user_id | 199344406 |
| octolytics-dimension-user_login | simstudioai |
| octolytics-dimension-repository_id | 912559512 |
| octolytics-dimension-repository_nwo | simstudioai/sim |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 912559512 |
| octolytics-dimension-repository_network_root_nwo | simstudioai/sim |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | a6c2f87cbcb6414452377b4967858ed6a66f1109 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width