diff --git a/src/admin/components/elements/Button/index.tsx b/src/admin/components/elements/Button/index.tsx index 4ddfc5faa7..b098e6d60e 100644 --- a/src/admin/components/elements/Button/index.tsx +++ b/src/admin/components/elements/Button/index.tsx @@ -53,7 +53,7 @@ const Button: React.FC = (props) => { className, id, type = 'button', - el, + el = 'button', to, url, children, @@ -130,8 +130,10 @@ const Button: React.FC = (props) => { ); default: + const Tag = el; // eslint-disable-line no-case-declarations + return ( - + ); } }; diff --git a/src/admin/components/elements/Button/types.ts b/src/admin/components/elements/Button/types.ts index 2cdadc7e7b..48eaaa3afb 100644 --- a/src/admin/components/elements/Button/types.ts +++ b/src/admin/components/elements/Button/types.ts @@ -1,10 +1,10 @@ -import React, { MouseEvent } from 'react'; +import React, { ElementType, MouseEvent } from 'react'; export type Props = { className?: string, id?: string, type?: 'submit' | 'button', - el?: 'link' | 'anchor' | undefined, + el?: 'link' | 'anchor' | ElementType, to?: string, url?: string, children?: React.ReactNode,