jakezatecky / react-checkbox-tree

A simple and elegant checkbox tree for React.

Home Page:https://jakezatecky.github.io/react-checkbox-tree/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

react 17.0.2 support

niku2021 opened this issue · comments

I have tried to add this tree view checkbox to my react project. its loading data no issue. but icons are not showing. I am using react 17.0.2. Its working on 16.8.6 version. I am not sure its my issue or this one not supporting. Please add support for new react versions

This component is supported for React 17 and React 18. Without knowing more of your setup, it is unclear why the icons are not loading for you. A CodePen project or similar that illustrates your issue would be helpful.

Assuming you are using the defaults, have you imported the Font Awesome icons?

thanks for your reply. I have created sample project. Can you please check this.

https://codesandbox.io/s/sample-treeview-1zwd3w?file=/src/index.js

Thank you for providing the sample project.

It was almost there. It did not include a reference to the Font Awesome CSS. I added this to the index.html:

<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/all.min.css" />

One other slight issue is that the Checkbox Tree defaults to the older Font Awesome 4 icons, which are incompatible with Font Awesome 5 or 6. I forgot about that. I had to also set the iconsClass="fa5" property (despite its name, it works with FA v6 too):

<CheckboxTree iconsClass="fa5" ... />

I will change this in a future release such that it does not default to v4.

See my fork of your CodePen here, which loads all of the icons.

Thank you very much for your reply!