Skip to content
Snippets Groups Projects
Commit b2bdaf04 authored by Joe Savona's avatar Joe Savona
Browse files

compiler: only resolve globals and react imports

Updates Environment#getGlobalDeclaration() to only resolve "globals" if they are a true global or an import from react/react-dom. We still keep the logic to resolve hook-like names as custom hooks. Notably, this means that a local `Array` reference won't get confused with our Array global declaration, a local `useState` (or import from something other than React) won't get confused as `React.useState()`, etc.

Still working on more tests.

ghstack-source-id: 3494c99d0f61570b9a67c3151e01f4204101dacd
Pull Request resolved: https://github.com/facebook/react/pull/29190
parent fcec4a65
No related merge requests found
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment