xhluca / react-in-python

Example using react and hooks inside pyodide with pure Python code. Based on: https://alpha.iodide.io/notebooks/420/

Home Page:https://xhlulu.github.io/react-in-python/index.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

React in Python

This shows you how to use React 16+ inside Python, using pyodide. The example shows how to update a very simple button using React hooks with only Python code. The only JS code needed is to interface JS with the Python code (thanks to Pyodide).

I recommend checking out pyodide if you are interested in running the pydata stack inside your browser via webassembly. Note that this is not a Py > JS transpiler - python, numpy, pandas etc. are really running inside your browser. This also allows you to import Python libraries from pip via micropip (see pyodide docs).

My tweet expands on this: https://twitter.com/xhluu/status/1420814963459960836

Inspiration

The original notebooks that tried to use React inside iodide (the predecessor to pyodide):

About

Example using react and hooks inside pyodide with pure Python code. Based on: https://alpha.iodide.io/notebooks/420/

https://xhlulu.github.io/react-in-python/index.html


Languages

Language:HTML 100.0%