Member-only story

Step by Step Guide: How to get started with React.js

Marika Lam
3 min readJun 4, 2024

--

Summary

Below we will go through with how to install a react app, call an API, retrieve the data from the API and display it on your local website.

Step 1

Install create-react-app locally on your machine.

npx create-react-app my-app
cd my-app
npm start

Step 2

Open http://localhost:3000/ to see your app.

Step 3

Let’s try to edit App.js and run the updated code

Below is the original file.

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>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
</div>
);
}

export default App;

Update line 10 with a text. Then save the file. Open http://localhost:3000/ and the website should update with your text.

import logo from './logo.svg';
import…

--

--

No responses yet