social.coop is one of the many independent Mastodon servers you can use to participate in the fediverse.
A Fediverse instance for people interested in cooperative and collective projects. If you are interested in joining our community, please apply at https://join.social.coop/registration-form.html.

Administered by:

Server stats:

487
active users

#reactjs

11 posts10 participants2 posts today

Happy Monday!

I believe that if you start the week by removing code is a good start of the week!

I learned how to leverage JWT to send encrypted data to the frontend.
And so I stripped down my system of hooks in React and also deleted completely an endpoint in Django that I was using solely to fetch user info.

Even more secure, with less code.

Holy ravioli.

I finally managed to have a working JWT authentication system between Django and React.

Major headache but I did it!

My only compromise (at least what it feels to me as a compromise) is that the SPA is abusing the refresh token to maintain the state of the logged in user, because I'm keeping the access token exclusively in memory.

Over-engineered solution for a simple CRUD app, but I'm learning a lot so I don't care.

How can something like a front end framework like #ReactJS that has supposedly been created to abstract and simplify writing #JavaScript “applications” be so fucking over-engineered and complicated, to the point that it needs dozens of libraries to simplify and abstract itself?

Where does this start to even make sense?

Continued thread

Thinking about this, I believe at least for me, what this course is breaking is the principle of learning new stuff ONLY if and when you need it.

There's no way you're gonna remember all the different React libraries for the rest of your life just by watching a few videos.

When I need to use something, I check it out.

And again, mixing too many different libraries to explain some basic workflow/pattern is particularly bad for a course like this.

Continued thread

An example?

Dealing with token authentication in #ReactJS.

The teacher attached this section to the previous section that was about React Router, by using the same code and expanding on it with the auth system.

Why? It's not a best practice IMO, I don't care about React Router all the times I build an auth system in React, at all!

I'd rather show how to implement token based authentication in a more vanilla React scenario.

And this is just one of the many bad practices in the course!

2/2

In the last few months I've been following this ReactJS course:

udemy.com/course/react-the-com

And I strongly advise against it.

Maybe it's very subjective but I now find that the course just made me waste a lot of time.

Not only is overly verbose and slow while treating the viewer like a dumdum, by repeating the same stuff over and over; but now that I know better, I can see so many pitfalls in the actual structure of the course.

1/2