UNPKG

mt-flowbite-react

Version:

Official React components built for Flowbite and Tailwind CSS

8 lines (7 loc) 422 B
import { createElement } from 'react'; import genericForwardRef from '../../helpers/generic-forward-ref'; const ButtonBaseComponent = ({ children, as: Component, href, type = 'button', ...props }, ref) => { const BaseComponent = Component || (href ? 'a' : 'button'); return createElement(BaseComponent, { ref, href, type, ...props }, children); }; export const ButtonBase = genericForwardRef(ButtonBaseComponent);