Skip to content

Add icon in node renderer #860

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
BBE78 opened this issue Jan 22, 2021 · 9 comments
Open

Add icon in node renderer #860

BBE78 opened this issue Jan 22, 2021 · 9 comments

Comments

@BBE78
Copy link

BBE78 commented Jan 22, 2021

Requesting a Feature?

Provide a way to add an icon in a node

BBE78 added a commit to BBE78/react-sortable-tree that referenced this issue Jan 23, 2021
@BBE78
Copy link
Author

BBE78 commented Jan 23, 2021

Implementation available in pull request #861
image

@oglisa-dev
Copy link

Did you try to use generateNodeProps for that? Maybe just emit subtitle and use title (ReactNode is type) as your icon + some other parts...

@BBE78
Copy link
Author

BBE78 commented Mar 19, 2021

Nop, do you have a capture of the result of this solution?

@ajoslin103
Copy link

I don't know how you got this project to work, but I'd love to see a code dump/pen/sandbox !!!

@BBE78
Copy link
Author

BBE78 commented Mar 25, 2021

I don't know how you got this project to work, but I'd love to see a code dump/pen/sandbox !!!

Hi @ajoslin103, this is available in the Pull Request #861.

@ajoslin103
Copy link

Apologies for being unclear - I cannot get this library to even start in my ElectronJS+React+Typescript project (built on this boilerplate: https://github.com/Robinfr/electron-react-typescript) I was hoping that someone had something running with react 16.8

@oglisa-dev
Copy link

Apologies for being unclear - I cannot get this library to even start in my ElectronJS+React+Typescript project (built on this boilerplate: https://github.com/Robinfr/electron-react-typescript) I was hoping that someone had something running with react 16.8

I am currently using this library in my project that is using React ^16.8.0 as dependency.
Maybe there is problem with new versions and features of typescript , currently I am using ^4.1.2 and also:
"@types/react-sortable-tree": "^0.3.12",
"@types/react-sortable-tree-theme-file-explorer": "^0.0.0"

Everything is working fine for me. Just I am not using suggesting (theirs) function for recursive updates of tree, make yourself good ones.

@oglisa-dev
Copy link

Nop, do you have a capture of the result of this solution?

You can do it in many ways, choice is left to you for implementation details.
Here is a quick ss to take a look:
image

@55Cancri
Copy link

@glisA99 Can you show code for this example?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants