Skip to content

Commit fb2ff81

Browse files
author
Stan Zhao
authored
Merge pull request #481 from sodoku/patch-1
Throw error if heading size is higher than 6
2 parents 6677d30 + 678345e commit fb2ff81

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/components/heading.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ export default class Heading extends Component {
8888
}
8989
render() {
9090
const { size, lineHeight, fit, style, children } = this.props;
91+
if (size > 6) {
92+
throw new Error('Heading size must be between 1 and 6');
93+
}
9194
const Tag = `h${size}`;
9295
const typefaceStyle = this.context.typeface || {};
9396

0 commit comments

Comments
 (0)