react-doctor/no-sync-xhr
Synchronous XMLHttpRequest
- Category: Performance
- Severity: warn
- Source:
oxlint-plugin-react-doctor - Framework: global
- Enabled when: always
- Default: Enabled
Validation prompt
Use this to decide whether a fired diagnostic is real or a false positive.
Confirm the reported code matches Synchronous XMLHttpRequest. Check the framework context and diagnostic message before suppressing it.
Fix prompt
Use this once validation confirms the diagnostic is real.
Never open an XMLHttpRequest synchronously (async = false). It blocks the main thread. Use fetch() or pass true and handle the response asynchronously.
Related rules
More Performance rules from the rules reference:
react-doctor/no-transition-all: List specific properties: `transition: "opacity 200ms, transform 200ms"` — or in Tailwind use `transition-colors`, `transition-opacity`, or `transition-transform`react-doctor/no-undeferred-third-party: Use `next/script` with `strategy="lazyOnload"` or add the `defer` attributereact-doctor/no-unstable-nested-components: Hoist nested components to module scope or memoize them — never define one inside another.react-doctor/no-usememo-simple-expression: Remove useMemo — property access, math, and ternaries are already cheap without memoizationreact-doctor/prefer-dynamic-import: Use `const Component = dynamic(() => import('library'), { ssr: false })` from next/dynamic or React.lazy()