removed createElement and used JSX

This commit is contained in:
Foster Irwin 2022-02-04 09:34:27 -07:00
parent e534c0eeeb
commit 0c4a61007e

View file

@ -2,17 +2,13 @@ import React from 'react';
export const HeaderText = ({type, text, link}): JSX.Element => { export const HeaderText = ({type, text, link}): JSX.Element => {
const anchor = React.createElement( const Header = type;
'a',
{className: "hash-link", href: `#${link}`, title: "Direct link to heading"}
)
const heading = React.createElement( return (
type || 'h1', <Header className="anchor anchorWithHideOnScrollNavbar_node_modules-@docusaurus-theme-classic-lib-next-theme-Heading-styles-module">
link ? {className: "anchor anchorWithHideOnScrollNavbar_node_modules-@docusaurus-theme-classic-lib-next-theme-Heading-styles-module"} : null, {text}
text, link ? anchor : null {link ? <a className="hash-link" href={`#${link}`} title="Direct link to heading"/> : null}
) </Header>
);
return heading
}; };