Skip to content

Production build breaks code that works in development #126

@modernserf

Description

@modernserf
import React from "react"

export default class App extends React.Component {
  render() {
    return (
      <div>
        <p>Parent</p>
        <AppItem />
      </div>
    )
  }
}

const AppItem = () => {
    return <div>child</div>
}

Works with npm start
Breaks with npm build, giving Element type is invalid error

If you rearrange the code so that AppItem is defined before App (or you use a hoisted function declaration) it works in both environments.

I suspect this has something to do with the react inline elements transformer?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions