Guides
Poi is not “shorter React.” Legal programs have fewer shapes: state in store, UI state in View sums, foreign through match, effects in capability slots.
| TS / React habit | Poi |
|---|---|
useState / zustand field | store({ n: 0 }) direct read |
useMemo | get x() { … } |
useEffect for fetch / storage | store method / effect() (not free in render) |
useRef + mount cleanup | ref={el => { …; return cleanup }} or bindImperative |
JSON.parse + cast | parseJson + field match |
| Scattered UI ifs | View sum + component only matches |
?. / ?? / === / for / try | Parse rejections — use match / Option / factories |
Business logic in .poi. Optional: components/ui may stay TSX (shadcn). Entry: main.poi + HTML. Tailwind: include *.poi in content / @source.
Full cookbook: docs/20-migrate-from-ts.md · scaffold: docs/19-app-scaffold.md.