Giter Club home page Giter Club logo

Comments (8)

holmsand avatar holmsand commented on May 10, 2024

No, the extra components are necessary. Reagent does all its bookkeeping by wrapping native React components, so that it can avoid unnecessary re-renderings etc.

React components are extremely cheap, they're are nothing like DOM elements in terms of cost. And they're especially cheap if they only have one child.

The missing feeling of "snappiness" might be caused by my example's use of on-mouse-up in the input field, rather than on-mouse-down. I've pushed that change to http://holmsand.github.io/reagent/ – check it out and see if it feels better.

from reagent.

borkdude avatar borkdude commented on May 10, 2024

This must have done the trick, feels snappy to me now. Thanks.

from reagent.

holmsand avatar holmsand commented on May 10, 2024

Always nice when you can add snappiness simply by changing "up" to "down" :)

from reagent.

borkdude avatar borkdude commented on May 10, 2024

I don't think this explains it, because I don't even use the mouse to add TODOs. Anyway, never mind, it seems to be OK now....

from reagent.

holmsand avatar holmsand commented on May 10, 2024

Oh, I meant on-key-down, but my fingers didn't listen to my head... See b1bec33

from reagent.

robinheghan avatar robinheghan commented on May 10, 2024

Hmm. But, even if it has a negligible performance impact (it still has an impact on diffing right?), it does make navigating the React tree through the react-plugin on chrome a little bit annoying. I don't know if this is that big of a deal (I don't use the react-plugin that much, but when I do, it's a bit annoying to navigate a tree twice as long as the html), but it's worth keeping in mind.

from reagent.

holmsand avatar holmsand commented on May 10, 2024

No, it does not affect diffing (React diffs one level in the component tree at a time, and there'll be the same amount of components at each level – and the single-child wrapper components that Reagent adds obviously don't need any fancy diffing).

The overhead should instead only be noticeable on the very first rendering – but as I said, it ought to be small.

The big win of this design, is that it fits very well into React's basic model: Reagent components are just normal React components, as far as React is concerned.

At the same time, Reagent components can use immutable data structures all the way down, and only need to re-render (and thus create the actual React components) when their arguments change.

from reagent.

robinheghan avatar robinheghan commented on May 10, 2024

Ahh ok, thanks for explaining :)

from reagent.

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.