hydrogen icon indicating copy to clipboard operation
hydrogen copied to clipboard

buttons now have type button by default

Open lordofthecactus opened this issue 3 years ago • 1 comments

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:

  1. Having this default button type improves dx
  2. No writing type=button on all buttons
  3. Most UI libraries (e.g. Chakra UI, MUI) use this as their default as well.

Reason not to do this:

  1. 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?

lordofthecactus avatar Sep 08 '22 05:09 lordofthecactus

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.

github-actions[bot] avatar Sep 08 '22 05:09 github-actions[bot]