soy nuevo en reaccionar
índice.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();Tarjeta.js
// import React from "react"; const Card = ()=>{ return( <div> <h1>I am A Card </h1> </div> ); } export default Card; como en los dos archivos que comenté // import React from 'react';
pero <Card/> (en index.js) y <div><h1>I am A Card </h1></div> (en Card.js) que luego se convierten en React.createElement(); Llamada de función
que requiere React , que ya comenté, por lo que debería darme un error 'React' is not defined no-undef pero no recibo ningún error aquí por qué.