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

Four modifications (sorry, should've made four PRs)

Open peeveen opened this issue 3 years ago • 1 comments

  1. Selection-change callbacks are now made outside of the setState hook. They were previously being called from within a setState Dispatch function, which (I think) meant that if the callback code modifies other app state, this causes a "cannot update a component while rendering another component" error. I had logged this as an issue earlier (https://github.com/naisutech/react-tree/issues/68), but my first proposed solution used useEffect hooks, whereas this PR'd code doesn't.

  2. I was working on Windows for a bit this week, so added some Windows-specific yarn scripts.

  3. IconRenderer function can now return null to use default icon behaviour. My own use case for this was that I liked the arrow for the Nodes, so only wanted to replace the Leaf icons.

  4. The animations prop controlled the "cascading" animation of the dropdown lists, but not the animation of the rotating arrow or the fade-in of the leaf selection color. This was clashing with the non-animated lists etc on my app, so I created a prop called animateSelection to control these (default=true), and renamed the other one to animateDropdown (default=false) though the legacy animations prop should still work.

peeveen avatar Jul 11 '22 13:07 peeveen

Hi, thanks for this. Not ignoring it. Just been very very busy. Will get back in next few weeks.

ortonomy avatar Aug 01 '22 01:08 ortonomy