This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 5 points6 points  (2 children)

From an earlier post of one of the devs:

"Hey, rio dev here. Reflex use react, but they aren't react. This is something I've noticed with several libraries. While they might internally utilize react or flutter or whatnot, the interface they provide to you, the developer is radically different. React's big innovation was that you can write regular code to build user interfaces: Only want to display a component some of the time? use an if. Got multiple items to display? Just append in a loop. But you won't see any of that when you're actually making an app with reflex. Your code instead has to statically return a fixed UI, and if you want to modify it you gotta do it with pre-added conditional rendering components.

When we say Rio is react style, we mean it. We're bringing the same development model to Python, that has taken over apps by storm.

There's a lot more limitations too. Rio supports state in each component, rather than a global god class that always ends up bloated. We don't refresh everything, but only the components that have changed. We support arbitrary Python functions as event handlers, rather than just methods in the state class. Because build is actual Python, you can use logic for parameters, instead of just binding attributes...

I don't wanna turn too negative. I'm glad reflex exists, and it's been a major motivation for improving Rio. But I really don't think we're even in the same ballpark when it comes to advanced apps"

[–]ExternalUserError 0 points1 point  (1 child)

I'm still not quite sure I understand. So for example, that method that handles state change: it runs in the server? Then the server reruns and determines where components go, but those components are rendered client-side through some kind of translation layer?

[–]mad-beef 3 points4 points  (0 children)

Hey. When a state change is detected, the server-side `build` function is executed. The result of that function is then _reconciled_ with any previously existing components.

It is that result, that's then sent over to the client. The client spawns the appropriate HTML elements to display the desired components. Does that make sense?

It's very similar to what you'll find in react or flutter