reactjs / react.dev

The React documentation website
https://react.dev/
Creative Commons Attribution 4.0 International
11k stars 7.51k forks source link

[Typo]: Code typo in React compiler reference link #6904

Open CottonCandyZ opened 4 months ago

CottonCandyZ commented 4 months ago

Summary

React Compiler Doc first Note references a link to the Working Group Discussion

There is a code typo in that discussion (comment inline):

  const $ = _c(3);
  if ($[0] !== todos || $[1] !== tab) {
    t1 = filterTodos(todos, tab);
    $[0] = todos;
    $[1] = tab;
    $[2] = t2; // should be t1?
  } else {
    t1 = $[2];
  }

  const visibleTodos = t1

Page

https://github.com/reactwg/react-compiler/discussions/6

Details

I cannot find any way to directly report this typo in discussion, so I am reporting here.

The problem is simple:

$[2] = t2; should be $[2] = t1;