Hacker News new | ask | show | jobs
by narush 1106 days ago
If you're interested in using React-style frontend programming in Python but want an experience / API closer to that of React, I recommend checkout out Reacton [1].

Similarly to this library, it gives you a `@component` decorator that allows you to create components out of functions. But it also: 1. Includes all existing React hooks (use_state, use_memo, etc) -- so you don't have to learn new patterns. I believe this results in a bit less magic (and so easier debugging) than just using raw variables. 2. Works with ipywidgets, so many existing data apps can be ported over very easily -- Jupyter users celebrate.

I'm not associated with the project, but I know the maintainers (creators of Volia [2]) and they are honestly excellent. I haven't use the project in production, but the getting starting guide is pretty compelling.

[1] https://github.com/widgetti/reacton [2] https://github.com/voila-dashboards/voila

2 comments

Thanks for the shout out.

The follow up of that is Solara: "NextJS, but in Python" :)

https://github.com/widgetti/solara/

I never expected to care about a UI library in Python, but my user research collaborators prefer Colab notebooks (as opposed to Observable, where my JS expertise would be relevant).

Now you (and the OP) have me pondering about building UIs in notebooks…

Not sure doing something in React is better than just learning the standard tools, but it's a good option to know exists.