reactjs / reactjs/react.dev

!path twice instead of checking for !path

Open
#5,747 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
11.8k
Forks
7.9k
Avg merge
1d 11h
Merged PRs (30d)
11

Description

In this conditional statement inside the if block, it is checking for !path twice instead of checking for !path and !heading. So, the corrected line should be:

if (!path || !heading) {

   let listItem = null;
          if (!path || !path || heading) {
            // if current route item has no path and children treat it as an API sidebar heading
            listItem = (
              <SidebarRouteTree
                level={level + 1}
                isForceExpanded={isForceExpanded}
                routeTree={{title, routes}}
                breadcrumbs={[]}
              />
            );

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the SidebarRouteTree conditional shown in the issue and inspect its surrounding route-tree logic. Done means the condition checks for a missing path or missing heading, with the site's existing checks passing.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react, typescript
Domain
documentation, web-dev
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.