Releases: ije/mono-jsx
Releases · ije/mono-jsx
v0.9.13
v0.9.12
v0.9.11
v0.9.10
v0.9.9
v0.9.8
Allow jsx element as atom value in CSR mode:
import { atom } from "mono-jsx/dom"
const route = atom<JSX.Element | null>(null)
const matchRoute = () => {
switch(location.path) {
case "/":
route.set(<Home />)
break
case "/about":
route.set(<About />)
break
default:
route.set(<E404 />)
}
}
window.addEventListener('popstate', matchRoute)
matchRoute()
document.body.mount(<div>{route}</div>)v0.9.7
v0.9.6
Introduce ref method for atom signal:
import { atom } from "mono-jsx/dom"
const width = atom(900)
function App(this: FC) {
return (
<div
style={{
width: width.ref(), // ✅ type safe and reactive
height: width.ref(w => Math.round(w * 9/16) ) // 🪄 computed height based on `width` atom
}}
>...</div>
)
}