Giter Site home page Giter Site logo

Comments (12)

alexcurtis avatar alexcurtis commented on July 20, 2024

@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.

alexcurtis avatar alexcurtis commented on July 20, 2024

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.

alexcurtis avatar alexcurtis commented on July 20, 2024

@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.

gbmhunter avatar gbmhunter commented on July 20, 2024

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.

alexcurtis avatar alexcurtis commented on July 20, 2024

@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.

alexcurtis avatar alexcurtis commented on July 20, 2024

@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.

gbmhunter avatar gbmhunter commented on July 20, 2024

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.

gbmhunter avatar gbmhunter commented on July 20, 2024

I am stuck in a loop with npm errors stating "Attempt to unlock , which hasn't been locked".

from react-treebeard.

alexcurtis avatar alexcurtis commented on July 20, 2024

@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.

alexcurtis avatar alexcurtis commented on July 20, 2024

@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.

gbmhunter avatar gbmhunter commented on July 20, 2024

@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.

alexcurtis avatar alexcurtis commented on July 20, 2024

@gbmhunter Thank you for your amazing support! I've added a Pledgie donate button to the Readme.

from react-treebeard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.