我剛剛開始學習 React。我使用 Create-React 生成了一個基本的應用程序。應用程序.jsimport React from 'react';const App = () => { return (<div>Hi There!</div>);};export default App;索引.jsimport React from 'react';import ReactDOM from 'react-dom';import App from './components/App';console.log(document.getElementById("root"));ReactDOM.render((<App/> , document.getElementById('root')));我收到一個錯誤錯誤:目標容器不是 DOM 元素。
錯誤:目標容器不是 DOM 元素。- 開箱即用的應用程序
ibeautiful
2022-07-21 21:02:57