React / foldkit-react-codegen

Semantic differences to know

  • Messages are built when the event fires. Foldkit builds the Message when the view renders; the compiled handler builds it on click. The two are the same when Message constructors are pure, which Foldkit views assume.
  • Memoization is dropped, and boundaries become functions. A lazy slot only skipped rebuilding identical output, so calling the view directly renders the same thing; wrap the caller in React.memo if it matters. A Submodel's slotId has no counterpart: the lifting dispatch is the whole boundary. Foldkit imports the output no longer references are removed, so a compiled module does not load the Foldkit runtime.
  • Keys are React's. Foldkit's keyed lists do not need keys. React warns about unkeyed lists, so use h.keyed or h.Key in lists you compile.
  • Only the listed attributes are checked against Foldkit's behavior. An attribute missing from the table is refused rather than guessed.