Meet the First React Component
Let's learn about the react component.
We'll cover the following...
Our first React component is in the src/App.js file, which should look similar to the example below. The file might differ slightly because create-react-app will sometimes update the default component’s structure.
Press + to interact
import React from 'react';import logo from './logo.svg';import './App.css';function App() {return (<div className="App"><header className="App-header"><img src={logo} className="App-logo" alt="logo" /><p>Edit <code>src/App.js</code> and save to reload.</p><aclassName="App-link"Href="https://reactjs.org"target="_blank"rel="noopener noreferrer">Learn React</a></header></div>);}export default App;
This file will be our focus throughout this tutorial unless otherwise specified. Let’s start by reducing the component to a more lightweight version for getting you started without too much boilerplate code from ... ...
Access this course and 1400+ top-rated courses and projects.