Got this when loading a component: ReferenceError: React is not defined
Tried this solution here: Uncaught ReferenceError: React is not defined
added following to webpack.config.json
externals: {'react': 'React' },
but then I got following error. So what is wrong?
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
What files / code should I show to provide you with more info?
Error is raised here:
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)
in LoginAndRegistrationL.tsx
funny, I removed everything from LoginAndRegistrationL.tsx
, only a raw componenet I left:
export default function LoginAndRegistrationL(props: {}) {
return <div></div>
}
Why it raise the error?
This componenet will be visible when a button press happens. Why other component does not raise "React" error, but this yes.