a tiny react-like js framework build by typescript
implemented features:
- only support function component
- support hooks:
- useState
- useEffect
- useLayoutEffect
- useRef
- no time slice support
import Leact from 'leact'
function Counter(){
const [count, setCount] = Leact.useState(0)
return <div>{count}</div>
}
Leact.render(document.getElementById("root"), <Counter/>)
"presets": [
[
"@babel/preset-react",
{
"pragma": "Leact.createElement",
"pragmaFrag": "Leact.Fragment",
"throwIfNamespace": false,
"runtime": "classic"
}
],
]