reimplementing react as an exercise
import { createRoot, useState } from '@ytoune/yt-react'
const App = () => {
const [count, setCount] = useState(0)
return (
<div>
<p>count: {count}</p>
<button onClick={() => setCount(c => c + 1)}>+</button>
</div>
)
}
createRoot(document.body).render(<App />)
-
jsx, jsxs
-
h (createElement)
-
render with simple html
-
rerender
-
useRef
-
useState
-
useEffect
-
useMemo
-
useReducer
-
createContext, useContext
-
array children, key prop
-
ref prop
-
useCallBack
-
style
-
dangerouslyuSetInnerHTML