mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
0c0bedd3775251a1ada059df05e0494797d9e9b9
New approach to hooks validation per recent discussion. The idea is to avoid false positives while still preventing serious violations. See the comments in the file for more details about the approach. It uses a somewhat similar idea to InferReferenceEffects in that we track a "Kind" for each IdentifierId, and various instructions propagate or derive a result Kind from the operands. Kinds form a lattice and can be joined, allowing us to be more precise about known vs potential hooks, and known vs potential _sources_ of hooks.
Languages
JavaScript
67.1%
TypeScript
29.4%
HTML
1.5%
CSS
1.1%
C++
0.6%
Other
0.2%