thien-do / moai

A React component library, where buttons look like buttons🗿
https://moai.thien.do
127 stars 26 forks source link

Button should pass onClick to its "a" render #287

Closed thien-do closed 2 years ago

thien-do commented 2 years ago

Currently we check if "href" exist to render either "button" or "a" inside "Button". In the case of "a", we don't pass the onClick. This is actually wrong since onClick is still useful for a. For example: https://nextjs.org/docs/api-reference/next/link#if-the-child-is-a-custom-component-that-wraps-an-a-tag