react-treebeard icon indicating copy to clipboard operation
react-treebeard copied to clipboard

Modifying the decorators, changes are reflecting all over the application.

Open jainvizz opened this issue 7 years ago • 1 comments

I am using react-treebeard React Tree View Component in my application and multiple places and it is working great.

But when I try to change the decorators for one place, the changes are taking effect all over the application.

How Can I can change the decorator for only one place in a way where it will not impact the other instances.

jainvizz avatar Sep 20 '17 13:09 jainvizz

I don't know if you made it work, but here's how I did it:

import {Treebeard, decorators} from 'react-treebeard';

const modifiedDecorators = Object.assign({},decorators, { Header: (props) => {
...
}});

then pass modifiedDecorators to your Treebeard as decorators.

Hope that helps.

mrybinski avatar Nov 14 '17 13:11 mrybinski