/pyuseref

Python version of useRef demo at: https://dev.to/ziratsu/the-useref-hook-in-react-3h98

Primary LanguagePython

Python React version of useRef Tutorial at:

https://dev.to/ziratsu/the-useref-hook-in-react-3h98

  • app.py: useRef demo

  • app_multi.py: multi-ref demo

  • app_state.py: using useState (controlled inputs) instead of useRef for comparison

  • pyreact.py: React wrapper functions

Setup:

$ python3.9 -m venv venv
$ . ./venv/bin/activate
$ pip install -r requirements.txt
$ npm install

Build and run with:

$ npm start

The application will be served up on Parcel's default port at:
http://localhost:1234

Open the developer console in the web browser to see the output.

Change script src in index.html to try different app modules