fix(examples): guard missing mount target in preact simple example#10208
Conversation
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe change adds explicit null-safety handling to the render call in the Preact example. Instead of passing possibly null element directly to render, the app element is now retrieved into a variable with a runtime check that throws if missing before rendering. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes Possibly related PRs
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 |
|
View your CI Pipeline Execution ↗ for commit be1bdde
☁️ Nx Cloud last updated this comment at |
More templates
@tanstack/angular-query-experimental
@tanstack/eslint-plugin-query
@tanstack/preact-query
@tanstack/preact-query-devtools
@tanstack/preact-query-persist-client
@tanstack/query-async-storage-persister
@tanstack/query-broadcast-client-experimental
@tanstack/query-core
@tanstack/query-devtools
@tanstack/query-persist-client-core
@tanstack/query-sync-storage-persister
@tanstack/react-query
@tanstack/react-query-devtools
@tanstack/react-query-next-experimental
@tanstack/react-query-persist-client
@tanstack/solid-query
@tanstack/solid-query-devtools
@tanstack/solid-query-persist-client
@tanstack/svelte-query
@tanstack/svelte-query-devtools
@tanstack/svelte-query-persist-client
@tanstack/vue-query
@tanstack/vue-query-devtools
commit: |
🎯 Changes
What
Adds a safety guard for the Preact simple example mount target before calling render().
Why
The example previously passed the mount target directly:
document.getElementById('app')
If the DOM element is missing or renamed, the example can fail at runtime with an unclear error. Since examples are frequently copied, adding an explicit guard improves reliability and developer experience.
Changes
Scope
Examples-only change. No package/runtime changes.
✅ Checklist
pnpm run test:pr.🚀 Release Impact
Summary by CodeRabbit