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

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

If a React component is not showing, first find out whether React mounted it, whether it returned output, and whether that output made it into the DOM. Check the browser console, then trace the component from root.render through imports, JSX, conditions, and state updates. If the element is in the DOM but invisible, investigate CSS and layout rather than changing component logic.

Start by locating where rendering stops

React’s render phase calls components to calculate the UI; its commit phase applies the result to the DOM. An initial tree needs a root and a call to root.render. Later renders follow updates, such as state changes. This distinction helps separate a component that never mounted from one that rendered no output or was committed but is not visible. See React’s render and commit guide.

  1. Check the browser console and build output for errors.
  2. Confirm the root target exists and the application calls root.render with the expected tree.
  3. Check that the component import points to the intended module and that the parent uses it as JSX.
  4. Inspect component returns and the conditions that determine whether JSX is included.
  5. For an update problem, check state setters and immutable updates.
  6. If the expected element exists in the DOM, inspect its CSS and layout.

1. The app never mounts the intended root

React cannot display the tree you expect if the render call never runs, targets the wrong tree, or is associated with a missing DOM element. Compare the target selected by your app with the element in the page, and confirm execution reaches the call that renders your app. React’s documented initial flow is to create a root for a DOM node and call root.render(<App />); target-selection checks are practical steps for tracing that flow. React: Render and Commit

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

2. The component does not return its JSX

A component may be called but produce no output if its function body does not return a React node. In a block-bodied arrow function, JSX on its own is not returned:

const Panel = () => {
  <section>Panel</section>;
};

Use an explicit return or an implicit-return expression instead:

const Panel = () => {
  return <section>Panel</section>;
};

const CompactPanel = () => <section>Panel</section>;

Also inspect early returns in the component. A class component’s render method should return a React node. React: Component

3. The import, export, or JSX reference is wrong

Check that the module exports the component you intend to use and that the importing syntax matches that export. A default export and a named export use different import forms; a mismatch can leave the parent referring to the wrong value or cause a build or runtime error. Use the console and build output to identify the actual module problem rather than changing syntax at random.

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

Then confirm the parent renders the component as JSX, such as <Panel />. React’s rules say components should be used in JSX rather than called directly as ordinary functions. Rules of React

4. A condition leaves the JSX out

Conditional rendering is a normal way to include or omit UI, but a false condition or an early return can mean there is nothing to display. Check conditions in both the parent and the component itself. React supports conditional logic with if, &&, and ternary expressions; returning null deliberately renders nothing. React: Conditional Rendering

To isolate the condition, temporarily render a stable marker in the relevant branch or inspect the values used to decide whether it should appear. If the marker appears, trace why the original condition evaluates as it does; if it does not, continue checking the parent path and errors.

5. A state update does not trigger the expected render

For state managed with useState, request an update with the setter React returns. Do not mutate the state value directly. When state is an object or array, create a replacement rather than changing the existing value and passing the same reference back; React may ignore an update when the next value is identical to the current one. React: useState

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

Also, a state variable inside an event handler is a snapshot from the render that created that handler. Calling the setter does not change that captured value immediately, so logging it on the next line does not tell you what the next render will show. Check a subsequent render or the committed UI instead. React: State as a Snapshot

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

6. An exception interrupts rendering

Look for a red error in the browser console and read its component stack to identify where rendering failed. A child that throws during render can prevent its intended subtree from appearing. Fix the underlying exception; where a fallback is appropriate, an error boundary can display fallback UI for errors in descendant components. React: Component

7. The DOM contains the element, but CSS hides it

Use browser developer tools to search the committed DOM for the expected element. If it is present, shift attention from React’s component logic to computed styles and layout. Inspect the element and its ancestors for dimensions, visibility, positioning, and overlays that might obscure it. React’s render-and-commit model distinguishes applying DOM output from how that output appears on screen; CSS and layout checks are browser-debugging steps, not a list of React-specific causes. React: Render and Commit

When development behavior differs under Strict Mode

Strict Mode performs extra development-only checks, including additional render calls intended to expose impure components. Do not assume that an extra development render is the production cause of a missing component. Check whether rendering has side effects or whether cleanup is incomplete, and make components pure functions of their props, state, and context. React: StrictMode and Keeping Components Pure

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.