mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
101ee3a440
The current allowlist for capitalized function identifiers only allows stdlib JS modules. This PR introduces a new compiler option to allow passing in a set of allowed capitalized user function identifiers. It's a hack (in the absence of a type system) to let us check that capitalized function calls are only possible for identifiers that aren't bound to a React component. I considered adding a mechanism in fixtures to configure compiler options per-fixture, but opted to keep it simple for now and special case a `ReactForgetSecretInternals` identifier as one allowed user function in transform tests.