Added high level ErrorBoundary

This commit is contained in:
Tom Moor
2017-11-12 16:08:55 -08:00
parent 0909dc61ff
commit ee89fb852b
4 changed files with 106 additions and 52 deletions

View File

@@ -15,6 +15,7 @@ type Props = {
readOnly: boolean,
component?: string,
attributes: Object,
className?: string,
};
function Heading(props: Props) {
@@ -26,6 +27,7 @@ function Heading(props: Props) {
readOnly,
children,
component = 'h1',
className,
attributes,
} = props;
const parentIsDocument = parent instanceof Document;
@@ -40,7 +42,7 @@ function Heading(props: Props) {
emoji && title.match(new RegExp(`^${emoji}\\s`));
return (
<Component {...attributes} id={slugish}>
<Component {...attributes} id={slugish} className={className}>
<Wrapper hasEmoji={startsWithEmojiAndSpace}>{children}</Wrapper>
{showPlaceholder && (
<Placeholder contentEditable={false}>