React newbie here
I got this error:
TypeError: Cannot read property 'StrictMode' of undefined
I think this is because re 'React.StrictMode' React is not defined. When commenting out the two lines mentioning React.StrictMode the code works fine. Doing some experimenting, I found that the issue is with the import.
import {React, useState} from 'react'; does not import React causing it to be undefined and error with this part of the code:
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
);
Doing this:
import React from 'react';
import {useState} from 'react';
is fine.
I'm wondering why the first method doesn't work
Thanks for your help!
Reactis default export so you annot import it likeimport {React, useState} from 'react'import like thisimport React,{ useState} from 'react'