【react+amis】The above error occurred in the <TableRenderer> component

衡高寒
2023-12-01

问题是:react中使用amis低代码开发时遇到的错误 

 Uncaught Error: Unable to find node on an unmounted component.
    at findHostInstanceWithWarning (react-dom.development.js:24281:1)
    at findDOMNode (react-dom.development.js:24804:1)
    at Table.componentDidMount (index.js:141:1)
    at commitLifeCycles (react-dom.development.js:20663:1)
    at commitLayoutEffects (react-dom.development.js:23426:1)
    at HTMLUnknownElement.callCallback (react-dom.development.js:3945:1)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:3994:1)
    at invokeGuardedCallback (react-dom.development.js:4056:1)
    at commitRootImpl (react-dom.development.js:23151:1)
    at unstable_runWithPriority (scheduler.development.js:468:1)



The above error occurred in the <TableRenderer> component:

    at TableRenderer (http://localhost:8080/index.bundle.js:55878:42)
    at StoreFactory (http://localhost:8080/index.bundle.js:6320:36)
    at BroadcastCmpt (http://localhost:8080/index.bundle.js:5763:28)
    at SchemaRenderer (http://localhost:8080/index.bundle.js:5814:28)
    at div
    at CRUDRenderer (http://localhost:8080/index.bundle.js:29825:28)
    at StoreFactory (http://localhost:8080/index.bundle.js:6320:36)
    at ScopedComponent (http://localhost:8080/index.bundle.js:6209:32)
    at BroadcastCmpt (http://localhost:8080/index.bundle.js:5763:28)
    at SchemaRenderer (http://localhost:8080/index.bundle.js:5814:28)
    at div
    at div
    at div
    at div
    at PageRenderer (http://localhost:8080/index.bundle.js:50793:28)
    at StoreFactory (http://localhost:8080/index.bundle.js:6320:36)
    at ScopedComponent (http://localhost:8080/index.bundle.js:6209:32)
    at BroadcastCmpt (http://localhost:8080/index.bundle.js:5763:28)
    at SchemaRenderer (http://localhost:8080/index.bundle.js:5814:28)
    at RootRenderer (http://localhost:8080/index.bundle.js:5473:28)
    at ImageGallery (http://localhost:8080/index.bundle.js:13347:47)
    at class_1 (http://localhost:8080/index.bundle.js:26926:50)
    at class_1 (http://localhost:8080/index.bundle.js:62543:50)
    at Root (http://localhost:8080/index.bundle.js:5380:42)
    at ScopedComponent (http://localhost:8080/index.bundle.js:6209:32)
    at AMISComponent (http://localhost:8080/index.bundle.js:111143:5)
    at AmisApp (http://localhost:8080/index.bundle.js:111237:5)
    at div
    at main
    at div
    at div
    at MainPage (http://localhost:8080/index.bundle.js:112363:5)
    at Layout (http://localhost:8080/index.bundle.js:111814:5)

React will try to recreate this component tree from scratch using the error boundary you provided, RootRenderer.

经反复查找原因,发现是 react版本过高,amis对react16以上版本不支持

解决:切换react版本,就可以了

npm install react@16.x react-dom@16.x --save

 类似资料: