Building a Mock API in React

  Рет қаралды 7,918

Cosden Solutions

Cosden Solutions

2 ай бұрын

🚀 Project React → cosden.solutions/project-react
Join The Discord! → discord.cosdensolutions.io
VSCode Theme | Font → Material Theme Darker | Menlo, Monaco "monospace"
In this video I will show you how I built a Mock API in React for my new React course, Project React. This mock API is built using axios, and functions exactly like a real API. You can fetch data, get responses, and handle loading and error states. The only difference is that the data is not coming from an endpoint, but rather from localStorage. This is a really cool way to learn how to fetch data in React without managing your own backend and database!

Пікірлер: 28
@stephanjames1536
@stephanjames1536 2 ай бұрын
You’re definitely the best. Keep it up!!! Other devs don’t even talk about tests. Bravo!!!
@jlemuelDev
@jlemuelDev 2 ай бұрын
Really excited for your project react course🔥
@usernamenotfound1229
@usernamenotfound1229 2 ай бұрын
Great initiative waiting for this😊
@realbigsquid
@realbigsquid 2 ай бұрын
Lolz from the guy who learned the hard way, this is pretty cool.
@pixyoutube538
@pixyoutube538 2 ай бұрын
Awesome thank you bro
@OffroadTreks
@OffroadTreks 2 ай бұрын
This is smart, becuase I usually get dropped into projects where someone else is setting up the API or dealing with data warehouse.
@cosdensolutions
@cosdensolutions 2 ай бұрын
That's exactly the goal! To simulate a real-world project
@buddytech7775
@buddytech7775 2 ай бұрын
In this course add redux also ,it helps both ways hooks and redux concepts ,add many filters and check boxes to help further.
@cosdensolutions
@cosdensolutions 2 ай бұрын
Yep, there's redux in there!
@coravityinfotech1660
@coravityinfotech1660 Ай бұрын
Nice way to explain. Mocks inside the application are good for learning projects, but how do you handle live projects? Isn't keeping mocks outside the code a better approach? Like MockServer or Requestly.
@cosdensolutions
@cosdensolutions Ай бұрын
this is for learning purposes only
@mutasimahmed8975
@mutasimahmed8975 2 ай бұрын
Covering just basics are all the advanced topics in your roadmap ? will you cover react query (please do )
@cosdensolutions
@cosdensolutions 2 ай бұрын
React Query is in part 2 which is coming a little later!
@mutasimahmed8975
@mutasimahmed8975 2 ай бұрын
cool best of luck waiting for the course desperately, some PPP for india and student discount would be graceful @@cosdensolutions
@ugogalliano1176
@ugogalliano1176 2 ай бұрын
Hi Cosden good work! Sorry but i think that you can avoid all this work, with the json-server package, right ?
@shrey768
@shrey768 2 ай бұрын
Absolutely
@cosdensolutions
@cosdensolutions 2 ай бұрын
Yeah you could, but you'd still have to implement auth yourself. Also, I wanted to show how an API backend would look like for those who want to learn in a safe and easy way
@HolySl0w
@HolySl0w 2 ай бұрын
can you tell me if there are any fetch request in the network tab? i didn't get it
@cosdensolutions
@cosdensolutions 2 ай бұрын
there aren't any, it's all mocked!
@brancode404
@brancode404 2 ай бұрын
Any Next.js course?
@ostap787
@ostap787 2 ай бұрын
Will you be using ts?
@cosdensolutions
@cosdensolutions 2 ай бұрын
Not for this one. Wanted to make it accessible to everyone
@mutasimahmed8975
@mutasimahmed8975 2 ай бұрын
when is it comping, ?
@cosdensolutions
@cosdensolutions 2 ай бұрын
Less than 2 weeks!
@onceUpon-A-Mic
@onceUpon-A-Mic 2 ай бұрын
How much is this course?
@cosdensolutions
@cosdensolutions 2 ай бұрын
Details are coming very soon!
@rugucloud
@rugucloud 2 ай бұрын
msw is better
@cosdensolutions
@cosdensolutions 2 ай бұрын
Produces the same result tbh, you won't directly touch this anws but its there for the curious ☺️
Why Did They Do This?! (Code Review)
18:48
Cosden Solutions
Рет қаралды 14 М.
Learn React Hooks: useMemo - Simply Explained!
13:41
Cosden Solutions
Рет қаралды 73 М.
[Vowel]물고기는 물에서 살아야 해🐟🤣Fish have to live in the water #funny
00:53
NO NO NO YES! (50 MLN SUBSCRIBERS CHALLENGE!) #shorts
00:26
PANDA BOI
Рет қаралды 94 МЛН
ОДИН ДОМА #shorts
00:34
Паша Осадчий
Рет қаралды 6 МЛН
Do you have a friend like this? 🤣#shorts
00:12
dednahype
Рет қаралды 16 МЛН
MirageJS - Easily make a mock API for React
36:08
Classsed
Рет қаралды 13 М.
React Native Bridgeless Mode for Dummies
6:43
Oscar Franco
Рет қаралды 3,1 М.
You Are Using useEffect Wrong
14:40
Cosden Solutions
Рет қаралды 29 М.
How I Write Clean Code in React
16:36
Cosden Solutions
Рет қаралды 21 М.
Mock Service Worker with React
39:20
Anson the Developer
Рет қаралды 8 М.
Design patterns in React
14:37
Cosden Solutions
Рет қаралды 138 М.
Setup VSCode like a senior React developer
13:43
Cosden Solutions
Рет қаралды 44 М.
Learn React Hooks: useCallback - Simply Explained!
17:15
Cosden Solutions
Рет қаралды 68 М.
You might not need useEffect() ...
21:45
Academind
Рет қаралды 140 М.
[Vowel]물고기는 물에서 살아야 해🐟🤣Fish have to live in the water #funny
00:53