@solid-weapp/runtime
v0.1.1
Published
Direct SolidJS renderer, node patch scheduler, native event dispatch, lifecycle hooks and JSX types for `solid-weapp`.
Readme
@solid-weapp/runtime
Direct SolidJS renderer, node patch scheduler, native event dispatch, lifecycle hooks and JSX types for solid-weapp.
Component props can opt into write-through state with the explicitly imported
twoWay() compiler directive and the child-side useTwoWay() helper. The
helper returns the parent setter, or undefined when the prop is not bound.
Read values directly from props; no local state is created. The
runtime also exports TwoWayBinding, TwoWaySetter, and TwoWayConverter
types. twoWay() must appear directly in a JSX component property; native
mini-program input events remain explicit.
Page navigation is available through the promise-based navigateTo(url, props),
redirectTo(url, props), and reLaunch(url, props) helpers. Navigation props
are passed by reference to the destination component alongside $query, $route,
and $page. The promise resolves only after the native call succeeds and the
source page is shown again or unloaded. Calls made before the preceding native
navigation reports success or failure are rejected.
Applications extend the empty PageRouteProps interface to associate canonical
page URLs with navigation props inferred from each destination component. The
helpers validate props from the URL literal, ignoring its query string. Destination
components extend PageComponentProps with their own navigation props.
See the main solid-weapp README for usage.
