hydrogen
hydrogen copied to clipboard
buttons now have type button by default
Description
Our buttons use the default browser type which is html. This change makes type button the default.
In react we usually have click handlers instead of relying in default html form submissions which force the page to re-render.
Reasons we should do this:
- Having this default button type improves dx
- No writing type=button on all buttons
- Most UI libraries (e.g. Chakra UI, MUI) use this as their default as well.
Reason not to do this:
- Defaults of browser are good enough and we should stick to them to improve our non-javascript code. e.g. form submissions without click handlers
Thoughts?
We detected some changes in packages/*/package.json or packages/*/src, and there are no updates in the .changeset.
If the changes are user-facing and should cause a version bump, run "yarn changeset add" to track your changes and include them in the next release CHANGELOG.
If you are making simple updates to examples or documentation, you do not need to add a changeset.