react icon indicating copy to clipboard operation
react copied to clipboard

Bug: Failed to execute 'insertBefore' on 'Node' And Failed to execute 'removeChild' on 'Node' with Chrome translate

Open 1291669609 opened this issue 3 years ago • 3 comments

  const [oneShow, setOneShow] = useState(false);
  const [twoShow, setTwoShow] = useState(true);
  
  return (
    <div>
      <h1>插入节点错误</h1>
      <div>
        <span>({oneShow && '插入节点' })</span>
      </div>
      <button onClick={() => {
        setOneShow(true)
      }}>触发
      </button>

      <h1>删除节点错误</h1>
      <div>
        <span>({twoShow && '删除节点' })</span>
      </div>
      <button onClick={() => {
        setTwoShow(false)
      }}>触发
      </button>

    </div>
  );

这代码在进行谷歌翻译后(请选择翻译成非中文)分别会触发插入删除节点的错误。


Edited by @bvaughn to add translation:

This code will trigger the error of inserting and deleting nodes after Google translation (please choose to translate into non-Chinese).

1291669609 avatar Nov 05 '21 07:11 1291669609

This looks like a duplicate of #17256


这看起来像 #17256 的副本

bvaughn avatar Nov 05 '21 13:11 bvaughn

Also possible duplicate of https://github.com/facebook/react/issues/11538. See https://github.com/facebook/react/issues/11538#issuecomment-417504600 for the latest update.

eps1lon avatar Nov 05 '21 13:11 eps1lon

This is a widespread problem with a long history, and the solutions have been collected and organized so far: https://github.com/facebook/react/issues/11538#issuecomment-2094671717

haitaojarvis avatar May 05 '24 07:05 haitaojarvis