-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
[docs] Document the onClick handler on Button #21234
Conversation
Details of bundle changes.Comparing: 4cbc014...be2de45 Details of page 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.
If we want to target beginners then including all this Snackbar related logic is likely too distracting.
I was thinking about simply adding onClick={() => alert('button clicked')}
. But I'm not a big fan of alert
since it disrupts the experience. I'd hope we could leverage babel to transpile this into our own implementation of alert
that would display a Snackbar that doesn't interrupt.
Sounds good. I will take a look at doing this with Babel. |
Maybe for a second pull request (it might require multiple)? I imagine using an |
OK. I tried to implement what @eps1lon was asking with Babel and was running into some challenges. Would love to see how this might work or how you would approach this. I just pushed a super simple version of this PR.
|
@hoop71 I have tried to push further the pull request. Assuming that the issue we try to solve is closing the gap between the DOM events and how to listen to them in JSX, I think that we can go with a simpler approach: Basically, no demo, only a few lines to make the connection in new developers' minds. Let me know what you think :). Regarding the Babel topic, I think that it will need further discussion. From what I understand:
|
Works for me! Simple is normally better. I will defer to you and @eps1lon on the best approach moving forward. Happy to help where I can! |
@hoop71 That is a good starter, thanks! |
This PR beings to address the documentation update in #21086
I have been following the conversation and I think there is value is this type of documentation. I started a WIP PR and would love feedback on making it better and what other examples might be useful.
I based this PR on
components/snackbars/snackbar
Happy to help how I can!
Closes #21086