相关疑难解决方法(0)

无法在React中使用FontAwesome在'Node'上执行'removeChild'

每当我尝试className='fa-spin'在React中使用FontAwesome微调器图标(带)时,我收到以下错误:

Uncaught DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.
at removeChild (http://localhost:5000/public/bundle.js:19553:22)
at unmountHostComponents (http://localhost:5000/public/bundle.js:13683:11)
at commitDeletion (http://localhost:5000/public/bundle.js:13727:5)
at commitAllHostEffects (http://localhost:5000/public/bundle.js:14419:13)
at HTMLUnknownElement.callCallback (http://localhost:5000/public/bundle.js:5035:14)
at Object.invokeGuardedCallbackDev (http://localhost:5000/public/bundle.js:5074:16)
at invokeGuardedCallback (http://localhost:5000/public/bundle.js:4931:27)
at commitRoot (http://localhost:5000/public/bundle.js:14508:9)
at performWorkOnRoot (http://localhost:5000/public/bundle.js:15510:42)
at performWork (http://localhost:5000/public/bundle.js:15460:7)
Run Code Online (Sandbox Code Playgroud)

编辑:现在问题出现了几次,代码本身并没有什么特别之处.我一直在使用微调器作为加载图标,每当微调器被内容替换时就会发生错误.例:

return (
  <div>
    {this.state.loading === true ? <i className="fa-spin fas fa-sync"></i> : (
      this.state.recipes.length === 0 ? (
        <div className='text-center'>
          <h2>There doesn't seem to be …
Run Code Online (Sandbox Code Playgroud)

font-awesome reactjs

17
推荐指数
1
解决办法
5806
查看次数

标签 统计

font-awesome ×1

reactjs ×1