This will be a short description of reusing our custom hook!
(since the next topic is so important I don't want to muddy it up with this information.)
we first start off by starting our JSON server
npx json-server — watch data/data.json — port 8000
That will run our JSON…
TODAY, we talk abour Router’s parameter and useEffect cleanup
So we can get parameters from a URL with the Route parameters,
localhost:3000/blogs/2 ←this guy
Its kinda like a variable which we can use later.
First, lets make BlogDetail in src folder, and then fill it with simple data…
Today we are talking about React Router a very important step in all this.
OK so lets get this going!
we first start off with installing “router dom”, just drop this into your terminal:
npm install react-router-dom
OK once that installs you go to the route component, Most likely the…
so we left off by running this :
You will need to run npm start (for localhost 3000 to run)
More importantly we need this to run:
npx JSON-server — watch data/data.json — port 8000
(if you copy and paste this, there should be two dashes in front of the…
today we continue with useEffect hook, dependencies with useEffect, and setting up the JSON server to fetch!
OK, to start, we should hop into the Home.js.
It should look like this, and we haven't changed anything since the last post:
lines 31–34 is all we are looking at anyways.
Today we talk about passing functions as props also stalk about the useEffect hook (basics).
we left off here :
BlogList is inheriting “blogs” from hooks in “Home.js,” and the “title” is what we want it to display as a header.
we commented on outlines 34–37 because the bottom BlogList…