Skip to content

Production build breaks code that works in development #126

Closed
@modernserf

Description

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?

Activity

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

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions