Heading React Component
import React from 'react' | |
import PropTypes from 'prop-types' | |
const Heading = ({children, cssClass, level}) => { | |
const Tag = `h${level}` | |
return <Tag className={cssClass}>{children}</Tag> | |
} | |
Heading.propTypes = { | |
children: PropTypes.node.isRequired, | |
level: PropTypes.number.isRequired, | |
cssClass: PropTypes.string | |
} | |
export default Heading |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
Usage: