-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add useEffectEvent shim for easier strictmode development #4345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Build successful! 🎉 |
Build successful! 🎉 |
Build successful! 🎉 |
Build successful! 🎉 |
Build successful! 🎉 |
import {useCallback, useRef} from 'react'; | ||
import {useLayoutEffect} from './useLayoutEffect'; | ||
|
||
export function useEffectEvent(fn) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably have a type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call, I'll add it in a PR where I use it. I think I'm going to do NumberField first
Build successful! 🎉 |
Build successful! 🎉 |
## API Changes
unknown top level export { type: 'identifier', name: 'Column' } @react-aria/utilsisVirtualPointerEvent-
+useEffectEvent {
+ fn: any
+ returnVal: undefined
+} |
* Add useEffectEvent shim for easier strictmode development
Closes
Is this where we want the code to live?
If it does, useLayoutEffect technically isn't ok in the stately package, so I'd need to move that in here as well
I can't quite tell if we'd need to use this in a stately package or only aria and up.
✅ Pull Request Checklist:
📝 Test Instructions:
🧢 Your Project: