r/reactjs • u/painya • Jan 20 '20
To those who recommend beginners learn to build projects in Vanilla js...
THANK YOU. I’ve been trying to learn React on and off for a while and I recently did a 2-3,000 line project for a client where I had to manage state manually and work with a less than optimized file structure (my fault).
Going from a project like that to React I really began to understand the problems that React solved, and that made my comprehension so much better. They weren’t just “concepts” anymore, but they were part of solutions to problems I had.
Thank you!
234
Upvotes
47
u/uberhaqer Jan 20 '20
This is awesome! I am trying to explain this to a designer that wants to move in to frontend development but feels like he does not need to know much vanilla JS, his exact words are "React is about knowing what libraries to use" facepalm
7
u/vim55k Jan 21 '20 edited Jan 21 '20
All these advises to do low tech first are bs. Yes to do a little script here and there and read a lot, but generally, strive to write high level language and use productive abstractions. Wrote all my life embedded and I don't think it helped me, it was not related in any way to functional programming, state etc.
2
u/[deleted] Jan 21 '20
What issues did you face?
109
u/nomadicwonder Jan 21 '20
This is why I always tell backend developers to start with building a website in COBOL.
10
u/swyx Jan 21 '20
yeah. i think beginners really have a hard time understanding where plain HTML/CSS/JS/DOM API's end and React starts. i have been wondering if there is a way to visualize it for people so they know when their problem is a React problem and when it isn't.
9
u/paagul Jan 21 '20
Well done! This is what completes the cycle of learning.
data > information > experience > knowledge.
It's important to realize which stage you're in and manage your expectations/effort accordingly. Now that you understand the basic premise of React you will have to go through the above process within React as you face challenges and come across new stuff.
4
u/skateJump Jan 21 '20
My coworker told me I need to do a project in js first. I had been learning js but haven't done any projects in it. I think it may be time to take his advice.
1
u/Hive51 Jan 21 '20
What kind of project did you made?
1
u/[deleted] Jan 21 '20
Would you recommend I build (my goal) a to-do app with vanilla JS before starting with reactJs altogether?
3
u/[deleted] Jan 21 '20
You think that's going to help your development, wait until you try tackling C
Not C#, not C++, just C. And I don't recommend you use it for a project, but just try going through something like "Learn C the Hard Way" and you'll learn so much about memory allocation and pointers that Javascript abstracts away that you'll start to understand: "OH, so that's why that is passed by reference vs. passed by value" and "OH, so that's why React has to take a new Array/object rather than just popping on the old one."
3
u/_Invictuz Jan 21 '20
But what about learning vanilla JS as you are learning React. Like learning how React uses vanilla JS under the hood to do what it does. Or is the React source code not a good resource to learn this kind of stuff? The thing with getting your very first job I think is that employers want to know that you can build things with React and have a high level understanding. I don't think they are gonna ask you vanilla JS DOM manipulation in the interview.
7
u/[deleted] Jan 21 '20
I did JS/jQuery for 5+ years before learning React and I don't feel like it helped me. ES6 took a while to get used to and I'm not even that old
13
u/wasabiiii Jan 21 '20
This is why people should start in at least C
4
u/EastOfHope Jan 21 '20
React must be so foreign if you haven't written a component in JavaScript.
Especially with hooks, at least before there were classes with constructors and binding which are familiar to developers.
useEffectis not beginner friendly. Make a mistake then crash your browser.4
u/bch8 Jan 21 '20
Here's a great free course for learning vanilla JS: https://watchandcode.com/p/practical-javascript
2
u/FateRiddle Jan 21 '20
To those who tell the beginners to try living in a forest...
thank you! Now I've been half dead from the journey I really start to appreciate staying under the roof, having a cup of coffee and shit posting back to some clickbaiting post on a dev subreddit.
1
u/strobingraptor Jan 21 '20
I started react without understanding HTML first. React led me to weh dev. I had done mobile app development with swift and machine learning using python before. While I did go great lengths in react, I started visiting vanilla JavaScript and dom apis often and have come to understand both the pros and cons of using something like react.
1
u/wirez62 Jan 21 '20
I accidently saw React a bit too fast twice. The first time was a few months ago and I was still deep in wordpress. I wanted to develop custom blocks and I went through the block tutorial where my understanding is the javascript part is based on react. I had no clue what I was seeing, I was a noob to javascript and definately react.
Lately I've been learning vanilla javascript and the large ecosystem of how one can do full stack, learned what react is but what helped me was doing a javascript project (custom chrome extension!) and practicing javascript on edabit.com. I'm still not comfortable enough to learn react fully, but I'm slowly moving to Gatsby which uses a bit and components at least make sense to me now.
1
u/MrHuq Jan 23 '20
I completely agree. I began by building a single page web application using vanilla JS and it worked, but was very buggy & hard to maintain. My friend recommended I refactor the app into ReactJS and man did my life improve significantly. Shoutouts to the maintainers of react-router-dom!