Repository navigation
@fiorejs/jsx 2.0.0
@fiorejs/jsx 2 builds on fiorejs 2.0.0 and its live-value protocol. JSX syntax is unchanged. It requires fiorejs 2.0.0.
Changes
- Data object: the runtime now produces
{ props, attrs, on, children }and callselement(type)(data)from fiorejs 2. - Live values instead of plugins: a prop or child is live when it is a live value, such as a signal or computed from
@fiorejs/signals2.0.0. A function is never live:class={() => …}passes the function itself, so writeclass={computed(() => …)}. On a custom element, a function prop is therefore always a callback. - Children: the runtime passes children to fiorejs, which flattens nested arrays at any depth, so
{items.map(...)}next to other children works as before. - Fragments: a lone live child inside
<>…</>keeps updating after the fragment is inserted. - Custom elements: an object value, which includes every live value, goes to the property of that name, as the README explains.
Install with npm install fiorejs @fiorejs/jsx and set jsxImportSource to @fiorejs/jsx; the README has the setup.