-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[data grid] Remove unnecessary comment in useGridApiOptionHandler
#14463
Conversation
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.
Thanks for the work, but I don't think we should merge this :| I don't see a need to add validation code if it's not catching an actual problem.
This will help prevent any future regressions. these are my Points of view. however, you know better than me, Feel free to close this if you want :) |
I'd rather close it, we have tests for all new features so I doubt we wouldn't catch an issue like this. |
export function useGridApiOptionHandler<Api extends GridApiCommon, E extends GridEvents>( | ||
apiRef: React.MutableRefObject<Api>, | ||
eventName: E, | ||
handler?: GridEventListener<E>, | ||
) { | ||
// Validate that only one per event name? |
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.
@romgrk Does it make sense to remove this comment, which motivates me to add these changes 😅
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.
Sure, that's an old comment. If you want you can update this PR directly, I'll re-open & merge.
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.
I have pushed a new commit in this PR, could you re-open this PR?
useGridApiOptionHandler
useGridApiOptionHandler
Deploy preview: https://deploy-preview-14463--material-ui-x.netlify.app/ |
Head branch was pushed to by a user without write access
0def428
to
97e4c10
Compare
useGridApiOptionHandler
useGridApiOptionHandler
doing this will ensure that we are not registering multiple event handlers with the same event name :)