import React from 'react';

const generateId = (headerText = '') => {
  return headerText
    .toString()
    .trim()
    .replace(/\s+/g, '-')
    .toLowerCase();
};

const GenerateHeaders = props => {
  const {
    idyll,
    hasError,
    updateProps,
    size,
    children = [],
    ...attributeProps
  } = props;

  const headerText = children.join('');
  const HeaderTag = `h${size}`;

  if (!attributeProps.id) {
    attributeProps.id = generateId(headerText);
  }

  return <HeaderTag {...attributeProps}>{headerText}</HeaderTag>;
};

export default GenerateHeaders;

@@ -508,26 +508,24 @@
 Props%7D%3E%7B
-headerText
+children
 %7D%3C/Heade

fix bug in generate header component