Hooks
Closed this issue · 3 comments
- useState
- useReducer
- useMemo
- useCallback
- useRef
- useContext
- useEffect
- useLayoutEffect
- useErrorBoundary
Does useContext/useLayoutEffect/useErrorBoundary
done?
It help me a lot, but havn't useContext/useLayoutEffect/useErrorBoundary
hooks.
@RedLove I've recently picked this project back up and have implemented all hooks as of 4.4.0 except useLayoutEffect
.
I'm curious about your use case for useLayoutEffect
. basic-pragma is a bit more simplified than React/Preact in how useEffect
is implemented, with the callback being invoked synchronously in the render function. useLayoutEffect
is traditionally invoked between DOM attribute changes and screen paints, but those steps are combined in basic-pragma as the adapter's createFrame
/updateFrameProperties
callbacks.
I implemented the same functionality using another approach, but your solution looks much simpler, more elegant, and better.