在使用react-dom、react-relay和react的实验版本时,我得到了如下错误
react_dom__WEBPACK_IMPORTED_MODULE_1___default.a.createRooTypeError: useTransition is not a function or its return value is not iterable发布于 2020-05-14 22:10:59
可以通过使用react-alpha 18 +来修复
yarn add react@alpha或
npm install react@alphacreateRoot和useTransition
import React from 'react'
import ReactDOM from 'react-dom'
import './index.css'
import App from './App'
import * as serviceWorker from './serviceWorker'
const rootEl = document.getElementById('root')
// @ts-ignore
ReactDOM.createRoot(rootEl).render(<App />)
// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
serviceWorker.unregister()https://stackoverflow.com/questions/61799502
复制相似问题