Comments (12)
@gbmhunter What I might do is put in a 'data-driven' boolean flag on the top level treebeard props. That can be used when you want the toggled
state to be driven completely via the data prop. Then have the fallback (like it currently works using component state) -- when people don't want to handle this and just want a quick default treeview. Does that sound reasonable?
from react-treebeard.
Or maybe Its best to simplify it right down and make it completely data driven. Which is more react-ish. It would however, mean everyone has to define an onToggle callback to get simple things like toggling the drawer to work.
from react-treebeard.
@gbmhunter I have reworked treebeard to be completely data driven. I think its the best way to ensure its easy to keep extending functionality in the future. It's currently in master. Could you please try it out and see if it works well for you? Thanks!
from react-treebeard.
Hi @alexcurtis ,
I have attempted to pull the latest master on GitHub with the command:
npm install git+https://github.com/alexcurtis/react-treebeard/react-treebeard.git --save
I had a look at some of the files after my attempted update, and the update seemed to have worked. However the view is still toggling while onToggle()
is empty.
I also did npm rm react-treebeard --save
first.
What's going on here?
from react-treebeard.
@gbmhunter I'm not exactly sure what happening in your project. But in the project example, if you clear out onToggle
then it definitely doesn't toggle. Are you using a cached version? I would also check where it is in node_modules and that the code pulled in via require
is the master branch.
from react-treebeard.
@gbmhunter Just thought. If you are using the master, you might need to compile down the lib before use. When I push to npm, this is automatic. But for now, whilst you test master, you will need to do this step.
Simply go into the directory and build using npm run lib
. Make sure you have all the dev dependencies.
from react-treebeard.
Woah, I'm running on a Windows machine and having many difficulties trying to install the dev dependencies. Many errors are being thrown when trying to run npm install -d
inside the react-treebeard folder. Note that I'm not a JavaScript programmer by trade and so it probably a little behind the ball when it comes to fixing this stuff.
from react-treebeard.
I am stuck in a loop with npm errors stating "Attempt to unlock , which hasn't been locked".
from react-treebeard.
@gbmhunter. I'll push this out to a npm release today. I'm quite happy with it being data-driven. But its a breaking change, so I'll bump up the version to 1.x.0. I'm in the middle of a decorator refactor, so once thats done, I'll push everything to a new release.
from react-treebeard.
@gbmhunter. I have release 1.1.0
to npm. This is a full data-driven release. No internal state. Hopefully it works as expected now.
from react-treebeard.
@alexcurtis works perfectly now thank you! BTW, do you have a donate button or something similar? I'm super impressed by the effort you've put into this open-source library.
from react-treebeard.
@gbmhunter Thank you for your amazing support! I've added a Pledgie donate button to the Readme.
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.