Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To troubleshoot a React bug, reproduce it, capture the exact console error and stack trace, and inspect the affected component’s props and state in React Developer Tools. Then fix the underlying cause—often impure rendering, mutated or redundant state, an Effect with incorrect dependencies or missing cleanup, or an error in a child component—rather than suppressing the symptom.

Start with evidence, not a guess

  1. Reproduce the smallest failing interaction. Note what you did, what you expected, and what happened instead. If possible, reduce the issue to one component and one interaction.
  2. Read the browser console. Record the full error and stack trace. When a state update seems wrong, the stack can help identify the setter responsible.
  3. Inspect the component tree. Use React Developer Tools to inspect the component, its props, and state. The Components panel helps locate what is rendered; the Profiler helps investigate repeated or expensive updates.
  4. Classify the symptom. Decide whether the issue is repeated rendering, unchanged or stale state, an Effect loop or leak, or a child rendering error. The right fix depends on which category the evidence supports.
  5. Change one cause at a time. Repeat the same interaction and check both the console and visible result after each change.

Why is my React component rendering twice?

First establish whether the duplicate work is happening only in development or also in a production build. React Strict Mode performs extra development-only checks, including an extra render intended to reveal components that are not pure. That behavior is a diagnostic clue, not by itself evidence of a production bug.

React expects rendering to be pure: for the same props, state, and context, a component should return the same output. Do not mutate props or state, or perform side effects such as changing an external system during render. Such code can behave inconsistently when React renders more than once. See Rules of React.

  • Look for assignments that modify an object or array received through props or read from state.
  • Move external work—such as subscribing, starting a timer, or connecting to a service—out of render and into the appropriate synchronization or event logic.
  • Keep Strict Mode enabled while debugging. Fix impurity rather than hiding the extra development check.

Why is my React state not updating?

Check the value passed to the setter and whether it actually differs from the current state. React may ignore an update when the next value is Object.is-equal to the current value. Mutating an existing object or array and passing that same reference back is a common way to produce an apparently ignored update.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

Instead, create a new value when changing an object or array, and keep state minimal. If one value can be calculated from another, derive it during render rather than storing a duplicate that can drift out of sync. React’s Managing State guide identifies redundant or duplicate state as a common source of bugs; the useState reference also recommends checking the console stack when the responsible setter is unclear.

  • Confirm the setter runs in the interaction you expect and receives the intended next value.
  • Do not mutate the existing state object or array before calling the setter.
  • Check whether the new value is actually different from the current one.
  • Remove duplicated state when it can be derived reliably from existing props or state.

Why is my useEffect running repeatedly or causing a loop?

Use an Effect to synchronize with an external system, such as a subscription, timer, connection, or browser API. If there is no external system to synchronize, you may not need an Effect: calculate the value during render or handle the action in its event instead. See Synchronizing with Effects and You Might Not Need an Effect.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
  1. Check the dependency list. Include the reactive values used by the Effect. If a dependency changes after the Effect updates state, trace that cycle to find why it repeats.
  2. Match cleanup to setup. Undo subscriptions, timers, connections, and other setup in the cleanup function. Cleanup should leave the external system in the state it was in before setup.
  3. Interpret Strict Mode correctly. In development, Strict Mode probes Effects with an additional setup-and-cleanup cycle. Make the Effect safe to set up and clean up; do not add a “run once” ref to mask missing cleanup.
  4. Reproduce the original interaction. After changing the Effect, confirm that it synchronizes as intended and that the repeated update or leak is gone.

An Effect that works only when it runs once is often relying on incomplete cleanup or an incorrect dependency model. The goal is not to limit how often React checks it, but to make setup and cleanup correct.

How do I diagnose a child component crash?

A try/catch around a JSX return does not catch errors thrown later while React renders a child. Put an Error Boundary above the subtree that may fail so it can handle descendant render errors. The official error-boundaries guidance describes this limitation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Use the error message and stack trace to locate the failing descendant, then inspect its inputs and state in React Developer Tools. An Error Boundary is for render failures in its descendants; it is not a general-purpose catch for errors thrown in event handlers or external callbacks.

What if the bug started after enabling React Compiler?

If the runtime issue began after enabling React Compiler, first check for violations of the Rules of React rather than assuming the compiler itself is the cause. The official React Compiler debugging guide identifies unstable Effect dependencies and reliance on referential equality among patterns to investigate. Verify that the component’s assumptions about object identity remain valid and that render logic is pure.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If your goal is to capture a page for debugging, ScreenshotNeo is a website screenshot API and MCP server. One GET request returns an image or PDF; for React bugs, it can capture the visible result, but it does not replace inspecting the component tree, console, or state.

Use a URL for the page you want to capture. The API key is available from your account; see the ScreenshotNeo API documentation for request parameters and output options.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

ScreenshotNeo removes cookie banners, newsletter popups, and chat widgets before capture; those cleanup steps can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and responses indicate the page verdict and billing status. Its MCP server includes take_screenshot, get_page_info, and capture_pdf for AI agents. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 screenshots.

Sign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month with no card.

React debugging checklist

  • Can you reproduce the issue with one clear interaction?
  • What exact console message and stack trace appear?
  • Are props or state being mutated, or is render performing side effects?
  • Is the state update a new value, or is it Object.is-equal to the current one?
  • Does each Effect synchronize with an external system, use the right dependencies, and clean up its setup?
  • Is the failure in a descendant render, where an Error Boundary is appropriate?
  • Does the same failure occur in production, or only during development checks?

Frequently Asked Questions

Where should I start when a React error has an unclear cause?

Reproduce the smallest failing interaction, then use the console stack trace to trace the error to a component or state setter.

Does React Developer Tools replace the browser console?

No. Use the console for errors and stack traces, and React Developer Tools to inspect components, props, state, and update performance.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.