| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [View Raw Code] [Original HTTPS Page] |
Hook primitives for @component functions: state, effects, memoization, context, and refs. Hooks must be called at the top level of a component (not inside conditionals or loops) so they can be matched to the same slot across renders.
::: pythonnative.hooks options: show_root_heading: false show_root_toc_entry: false members_order: source filters: ["!^_"]
For coroutines and data-driven UI, PythonNative ships dedicated async-aware hooks layered on top of use_state / use_effect:
See the Async + data guide for a complete walkthrough.
These hooks subscribe to values published by pythonnative.platform_metrics and re-render the component when they change. The screen host is the only code that updates the underlying values; user code consumes them.
For most apps the dedicated [KeyboardAvoidingView][pythonnative.KeyboardAvoidingView] component is preferable to consuming use_keyboard_height directly.
State setters schedule a render through pythonnative.scheduler. [batch_updates][pythonnative.scheduler.batch_updates] coalesces several setter calls into one render, and each reconciler owns a [TransitionQueue][pythonnative.scheduler.TransitionQueue] that defers renders started inside [use_transition][pythonnative.use_transition].
::: pythonnative.scheduler options: show_root_heading: false show_root_toc_entry: false members_order: source filters: ["!^_"]
| Back | FazBrowse Home | New Git URL |