react-component / react-component/tree

switcherIcon not working as expected

Open
#538 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1.3k
Forks
490
Avg merge
3d 17h
Merged PRs (30d)
5

Description

I want to implenent switcher icon with fontawesome icons but its not working. it still shows the default icons

here is my code,

                      <Tree
                          defaultExpandAll={false}
                          selectable={false}
                          switcherIcon={(obj) =>
                            obj.expanded ? (
                              <i className="fa-solid fa-arrow-down"></i>
                            ) : (
                              <i className="fa-solid fa-arrow-up"></i>
                            )
                          }
                        >

here is a code sample https://codesandbox.io/s/inspiring-ride-jqnlzo?file=/App.jsx

Contributor guide

No contributing guide indexed for this repository

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

Start with App.jsx in the linked CodeSandbox and inspect the Tree component's switcherIcon entry point. Reproduce the issue, determine why the default icon remains instead of the supplied Font Awesome icons, and consider the issue done when the expanded and collapsed states render the requested icons.

Written by the indexing model from the issue text.

Assessment

Tech stack
react
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.