I am new to react
index.js
// import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import Card from './Card';
import 'tachyons';
import reportWebVitals from './reportWebVitals';
ReactDOM.render(
<Card/>,
document.getElementById('root')
);
// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint.
reportWebVitals();
Card.js
// import React from "react";
const Card = ()=>{
return(
<div>
<h1>I am A Card </h1>
</div>
);
}
export default Card;
as in both the file I commented // import React from 'react';
but <Card/>(in index.js) and <div><h1>I am A Card </h1></div> (in Card.js)
which later turn into React.createElement(); function call
which requires React which I already commented so it should give me an error 'React' is not defined no-undef but I am not getting any error here why.