Coder Social home page Coder Social logo

Comments (4)

leefsmp avatar leefsmp commented on June 16, 2024

The reason the lib is changing the body class is because it usually happen that when dragging a splitter while resizing the mouse pointer is not exactly on top of the splitter element, hence if the cursor css is only applied to that element it causes a flickering as the cursor icon is intermittently being modified. That way it's constant during the drag.

It is surprising to me that your whole app is being rerendered as it is using directly DOM API and doesn't affect React props. I think a workaround would be to optimize your root component or some parent component (your table or higher in the hierarchy) to not rerender as their props is obviously not changed. If your table component is that heavy to render it is anyway a good initiative to optimize its rendering to the strict minimum.

from re-flex.

Mattes-D avatar Mattes-D commented on June 16, 2024

Thanks for the explanation @leefsmp, I didn't check what happens with the cursor during resize operation. I investigated the performance problems I have with my tables and was stumbling across the fact that clicking the ReflexSplitter without actually resizing already produces a lag of 2 seconds. The class names that are added to the body trigger a style recalculation of the whole app which are quite expensive in my case.
I'm using Reflex to resize a layout with several tables so I can't avoid rendering the tables. Optimizing my table styles was not sufficient, but virtualizing the tables seems to do the trick.

from re-flex.

leefsmp avatar leefsmp commented on June 16, 2024

I'm testing with this simple codepen and I can't reproduce the behavior you describe, resizing the splitter will not trigger a re-render of the containing component. The issue you are describing here seems to be specific to your project. If you can provide a testable minimal case that would be helpful.

from re-flex.

leefsmp avatar leefsmp commented on June 16, 2024

closing as non-reproducible.

from re-flex.

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.