Full Stack React & Django [3] - Redux & HTTP

preview_player
Показать описание
In part 3 we will implement Redux and start making calls to the API within actions. We will setup our lead reducer and make the form and leads component functional.

Code:

Helpful Links & Tuorials:

💖 Become a Patron: Show support & get perks!

Website & Udemy Courses

Follow Traversy Media:
Рекомендации по теме
Комментарии
Автор

For anyone whose DELETE_LEAD method/button is not functioning as expected:

My DELETE_LEAD method was not deleting, so I looked at my terminal and realized that the DELETE request was producing a 403 error. After some searching, I found this Stack Overflow answer that helped. I added the lines to my actions/leads.js file right underneath the exports and it worked great!


Thanks for the tutorial, Brad :)

mattzeepk
Автор

Brad you're the best web development teacher on YouTube

codewithlek
Автор

Redux is so freaking confusing. I'm really thankful that you explained it a bit more, and it isn't that confusing anymore :)

ruslanyakushev
Автор

OMG that axios delete request was driving me nuts
For a while I thought that the backticks triggered the delete...

Finally, after a power walk, I desided to let it go... let future me, deal with that!
30 sec later, it was not a get, but a delete request

becunim
Автор

17:17
I think it's important to mention that the nested function definition for the action creator here is permitted by the thunk middleware. That puzzled me for a minute, since redux tutorials don't mention middleware early on.

dumblerumble
Автор

Damn, whenever you say "This might look confusing to you", I'm like "Yeah, you're right"

ShaffleOne
Автор

some clarification that can benefit developers who are not experienced in React world from my research:
* the way he implemented leads action creator is something related to redux-thunk so you can search for it.
* for the static propTypes definition, it's not in ES2015, it's some thing called public static fields in JS OOP, and the transform-class-properties plugin is responsible for transpiling it.

mohammadsamir
Автор

I'm not sure if its because this is the second or third time I have seen Redux explained, but you make these concepts click. Thank you for that because I was pretty lost until this point.

taylorcouncil
Автор

If you're getting a "detail": "CSRF Failed: CSRF token missing or incorrect.". error then add this line of code in your settings.py




REST_FRAMEWORK = {
(
'rest_framework.authentication.BasicAuthentication',
)
}

alimansour
Автор

If you're struggling with <Form /> or <Leads /> not displaying correctly (or not displaying at all):
make sure you have Form and Leads declared in their respective classes WITHOUT any exports (contrary to what Brad shows), BUT with an export at the end.
ALSO make sure you have your Dashboard class declared as "export default function Dashboard() {...}" in your Dashboard.js file.

DogLabel
Автор

Congratulate me ! Finally I understand how redux works . Thank you master !!!!

manukyanq
Автор

hello Brad 25:03 In Redux Tools state of leads not getting? can you help me.
Action of payload i getting object but in state (leads .leads not getting the data)

mathavandeskways
Автор

hey, I am getting an error at 24:49. There is nothing getting rendered. The error says: Uncaught TypeError: this.props.getLeads is not a function

vatsalsinha
Автор

I'm getting an Error that this.props.addLead() is not a function inside the onSubmit function. Cant find the solution..

Mzl-ij
Автор

basic redux is a headache... Can you please make an article or something to demonstrate how to change this example to a redux-toolkit based example ?

skandarsouissi
Автор

This is a great series, much appreciated.

lardosian
Автор

"DELETE /api/leads/1/ HTTP/1.1" 403 58
Forbidden: /api/leads/1/

nor post also work only get working

skyblaze
Автор

I love you man, thank's for helping me getting out of the nightmare that is to use vanilla js

luanhenning
Автор

Brad I'm literally in love with u

leslie
Автор

Can you please expain why we use combine reducers, as we are using switch case to handle different types of actions and we can pass that reducer directly to the store, then what is the need of the combineReducers there.

BTW thank u so much for the course. Cleared most of the confusions regarding redux.

programmingpython