Skip to content

TypeError: Cannot read property 'getCurrentStack' of undefined #71

Description

@ubuntugx

hello, I got the error TypeError: Cannot read property 'getCurrentStack' of undefined when render, Do you know where i use in a wrong way?

export const getResEmailData = (dataArr) => {
  if(!dataArr) return '';
  return renderEmail(<Email title="email">{dataArr && dataArr.map((item, index) => {
    if(Array.isArray(item)){
      return <Item key={index}>{item.map(partOfline => handleEmailItem(partOfline))}</Item>
    }
    return <Item key={index}>{handleEmailItem(item)}</Item>
  }
    )}</Email>)
}
const handleEmailItem = (line) => {
  switch (line.tag) {
    case RICH_CONTENT_TYPE.img:
      return <Image src={line.src} />
    case RICH_CONTENT_TYPE.text:
      return <Span>{line.text}</Span>
    case RICH_CONTENT_TYPE.title:
      return <Span>{`<h${line.level}>${line.text}</h${line.level}>`}</Span>
    case RICH_CONTENT_TYPE.a:
      return <A href={line.href}>{line.text}</A>
    default:
      break;
  }
}
react-dom-server.browser.development.js:2560 Uncaught (in promise) TypeError: Cannot read property 'getCurrentStack' of undefined
    at pushCurrentDebugStack (react-dom-server.browser.development.js:2560)
    at ReactDOMServerRenderer.read (react-dom-server.browser.development.js:3155)
    at Object.renderToStaticMarkup (react-dom-server.browser.development.js:3660)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions