Comments (4)
Hi. The data decorators are applied on a single level intentionally. This is a special use-case, where you want to associate a specific decorator with a specific item of data.
If you want to blanket change the decorators, insert them as props when declaring the Treebeard Element:
<Treebeard data={...} decorators={decorators}/>
from react-treebeard.
doesn't work for me. I tried
const decorators = { Loading: (props) => { return ( <div> LOADING! </div> ) }, Header: (props) => { return ( <span style={props.style}> {props.node.name} Blat </span> ); }, };
and putting it on the component like you suggested , however I get
Warning: React.createElement: type should not be null, undefined, boolean, or number. It should be a string (for DOM elements) or a ReactClass (for composite components). Check the render method of NodeHeader
.
and Uncaught Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. Check the render method of NodeHeader
.
from react-treebeard.
you currently need to extend the default decorators or make sure you create them all from scratch. Please see the example.
I'll add in functionality to fall back to defaults if not provided -- but for now, id just extend.
from react-treebeard.
ok, will give it a try
from react-treebeard.
Related Issues (20)
- Example doesn't work HOT 2
- Is it possible to change the Icon? HOT 1
- [Question] Is it possible to expand node without selecting it? HOT 15
- How to get name for parent node?
- Example code does not work as expected. Parent and child nodes all get highlighted when expanded
- How to handle right click events over folders and nodes (files)? HOT 4
- style object is mutated by a component it's passed to HOT 1
- its impossible to update treebeard from client side dynamically?
- How to Pass nodes in custom toggle decorater
- Performance for large numbers of files
- Update data when new file is added HOT 1
- Using array for multiple root nodes fails when interacting with tree (example included) HOT 3
- responsive
- Uncaught Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object. Check the render method of `VelocityTransitionGroup`. HOT 2
- Show buttons to the right when hovering on a node? HOT 1
- [Request] Do not show polygon if no children are provided.
- Dynamically add children through API
- [Question] Display more than the name HOT 1
- [Bug] Arrows in markdown are way off on the right HOT 1
- [Question] Remove onToggle from file nodes? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-treebeard.