Estou fazendo uma aplicação React por CDN, e na hora de importar componentes tenho o seguinte erro:
Uncaught ReferenceError: require is not defined
at <anonymous>:3:14
at i (babel.min.js:24:29679)
at r (babel.min.js:24:30188)
at o (babel.min.js:24:30596)
at u (babel.min.js:24:30969)
at f (babel.min.js:1:1812)
at babel.min.js:1:6287
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script crossorigin src="https://unpkg.com/react@18/umd/react.development.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@18/umd/react-dom.development.js"></script>
<title>Document</title>
<script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
</head>
<body>
<div id="root"></div>
<script type="text/babel">
import App from "./Componentes/index.js"
ReactDOM.render(<App />, document.getElementById('root'))
</script>
</body>
</html>
class App extends React.Component {
render() {
return (
<div>
<h1>Ola Mundo</h1>
</div>
)
}
}
export default App;
Quero apenas escrever Ola Mundo na tela, com um componente importado