Overview of ReactPy concepts
mainReactPy is a library for building user interfaces in Python without needing JavaScript. It uses a component-based architecture similar to ReactJS. Key concepts include:
- Components: Reusable UI elements created using the
@componentdecorator. - Hooks: Special functions (starting with
use, such asuse_state()) that allow components to 'hook into' ReactPy capabilities like state management. Hooks must only be called during the rendering process. - State: Managed via hooks like
use_state(), which provides a state variable and a state setter to allow components to 'remember' information (like input values or shopping carts) and respond to user interactions.