Skip to content

[Compiler Bug]: Does not correctly identify components returned from factory #31262

@imjordanxd

Description

@imjordanxd

What kind of issue is this?

  • React Compiler core (the JS output is incorrect, or your app works incorrectly after optimization)
  • babel-plugin-react-compiler (build issue installing or using the Babel plugin)
  • eslint-plugin-react-compiler (build issue installing or using the eslint plugin)
  • react-compiler-healthcheck (build issue installing or using the healthcheck script)

Link to repro

https://playground.react.dev/#N4Igzg9grgTgxgUxALhASwLYAcIwC4AEAVAQIZgEBKCpchAZjBBgQOQw12sDcAOgHYCEADxz4CAEwT1SUADYMo-Omgj8CAWQCeAQSxYAFAEoCwAQQIc8sdQB4JaAG4A+ABII5ciAQDquORK2APQOLnz8AL4CAvRKKmoEAGIQEMam5gRwamCEANr8pBgIADQEYAh4AHKFCAC6BAC8VJx4AHRQ5QDKeKR4CAasrEbhFlY2BLYAFgCMbh5epgVFEcEzzgJRgvyxyniq6nAcvQjJqSZm6pYV4zvx6qdpFxYWWfw5BPk1peVVNfVN1FobQ6CG6xwGQxGzzGMDsa3cnm8wCWCBWQTWGU2mxAESAA

even without state, the output is questionable: https://playground.react.dev/#N4Igzg9grgTgxgUxALhASwLYAcIwC4AEAVAQIZgEBKCpchAZjBBgQOQw12sDcAOgHYCEADxz4CAEwT1SUADYMo-Omgj8CAWQCeAQSxYAFAEoCwAQQIc8sdQB4JaAG4A+ABII5ciAQDquORK2APQOLnz8AL4CAvRKKmoEAGIQEMam5gRwamCEANr8pBgIADQEYAh4AHKFCAC6BAC8VJx4AHRQ5QDKeKR4CAasrEbhFlY2BLYAFgCMbh5epgVFEcEzzgJRgvyxyniq6nAcvQjJqSZm6pYV4zvx6qdpFxYWQUGZ2XlLJWUV1UX1TWotDaHQQ3WOAyGI2eYxgdjW7k8EFKAHd-IEgmsMptNiAIkA

Repro steps

Simply create a function that returns a React function component. This is completely valid code.

How often does this bug happen?

Every time

What version of React are you using?

19

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions