Obtuve esto al cargar un componente: ReferenceError: React is not defined
Intenté esta solución aquí:Error de referencia no detectado: Reaccionar no está definido
agregado siguiente a webpack.config.json
externals: {'react': 'React' },pero luego obtuve el siguiente error. Entonces, ¿qué está mal?
external "React":1 Uncaught ReferenceError: React is not defined at 63804 (external "React":1:18) at n (bootstrap:19:32) at shortcode32.js?ver=2.0.37:2:317202 at shortcode32.js?ver=2.0.37:2:385167¿Qué archivos / código debo mostrar para brindarle más información?
El error se plantea aquí:
react-dom.production.min.js:194 ReferenceError: React is not defined at R (LoginAndRegistrationL.tsx:2:2) at Yi (react-dom.production.min.js:145:98) en LoginAndRegistrationL.tsx gracioso, eliminé todo de LoginAndRegistrationL.tsx , solo dejé un componente sin procesar:
export default function LoginAndRegistrationL(props: {}) { return <div></div> }¿Por qué levanta el error?
Este componente será visible cuando se presione un botón. Por qué otro componente no levanta error de "Reaccionar", pero este si.