Views
Beta notice: This page is being built.Edit on GitHub(opens in new tab)
Create each interface as a .jsx file exporting a default React component. LongLink supplies UI components, hooks such as useState() and useEffect(), fragments, queries, and scoped requests directly, without imports or a React. prefix. Your Python Solution needs no frontend build.
items/[item].jsx/** @param {ViewProps} props */export default function Item({ params }) {const [item] = useApi(`/api/items/${params.item}`);return <Heading>{item.name}</Heading>;}
| API |
|---|
navigate(path)Navigates within the current Solution or opens an HTTP(S) URL in a new tab. External URLs require user activation and open without an opener or referrer. |
request(path, options)Requests a Solution operation and returns its data. Options support the HTTP method, JSON, form data, and binary responses. Successful writes refresh cached View data. Failed HTTP requests reject with an Error containing an optional numeric status and a bounded client-facing message. |
useState(initial)Returns the current state and a setter. Pass a value or an initializer function; updates can use the previous state. |
useEffect(effect, dependencies)Synchronizes with external systems after rendering. Return a cleanup function to release timers or subscriptions. Include every reactive value used by the effect in its dependencies. |
useMemo(factory, dependencies)Caches a calculated value until its dependencies change. Use it for expensive calculations, not required application state. |
useRef(initial)Returns a stable object with a mutable current property. Changing current does not trigger a render. |
useApi(path)Returns Solution data and an awaitable invalidator scoped to the full request path. The renderer handles initial loading, errors, and retry. |