5 Common React Beginner Problems 2018

  Рет қаралды 69,605

Syntax

Syntax

Күн бұрын

In this video I give 5 common problems React beginners might face.
1. Adjacent JSX elements
2. Cannot call setState on undefined
3. Outdated React.createClass syntax
4. Incorrect imports / exports
5. Including Redux too soon
Video Links
React 16 For Everyone: goo.gl/MkRA11
Become a Pro: www.leveluptutorials.com/pro
Affiliate Links
Please use these links when signing up for services to help support Level Up.
Easy Hosting with Netlify: goo.gl/pychVP
Shared Web Hosting: goo.gl/pfC6uc
Level Up Links
Syntax Podcast ft Scott Tolinski & Wes Bos: goo.gl/7jDDxX
Subscribe to the Level Up Newsletter
eepurl.com/AWjGz

Пікірлер: 80
@IncolasCopperfield
@IncolasCopperfield 4 жыл бұрын
i was a newb stuck on the "accessing this from inside a function" problem... i felt so fortunate that i watched your video ! now i can move on and get stuck on another easy problem soon enough xD
@subvind
@subvind 6 жыл бұрын
also, if you only need to update a small part of the page put it in its own component and use setState, otherwise the entire page will need to render every time the small part needs to be updated; this has because more apparent as I've developed with >1 year of react building in next.js/react native. great vid btw.
@darkclonii
@darkclonii 4 жыл бұрын
This is the best react explanation I've seen. You got a thumb and a new subscriber. Thanks a lot.
@ArisFilms
@ArisFilms 6 жыл бұрын
Straight to the point and very helpful!
@bradt5426
@bradt5426 6 жыл бұрын
How did you restyle your inspector in Chrome?
@guacamole456
@guacamole456 5 жыл бұрын
Here is another one, using { } when returning JSX in a map function instead of ( ). It generates no error, but nothing renders on the front-end.
@npc73x
@npc73x 2 жыл бұрын
mine one is, it's everything works by sredux and when user refresh aa page, boom, Uncaught TypeError: Cannot read properties of null
@jessekrim9268
@jessekrim9268 5 жыл бұрын
Great vid and love the podcast!
@logkdogk
@logkdogk 5 жыл бұрын
Awesome, love this video. Really removing roadblockers.
@rinatvaliullov3247
@rinatvaliullov3247 5 жыл бұрын
Why you don't use "return" statement in the "runFunc" function?
@fatwaanugerah5354
@fatwaanugerah5354 3 жыл бұрын
Please tell me your vsc theme name
@ErikKubica
@ErikKubica 4 жыл бұрын
this vid makes me feel like a pro. i would like to figure out what makes someone junior react developer vs and what makes them senior.
@SergioArroyoSailing
@SergioArroyoSailing 3 жыл бұрын
Thanks! do you have an updated one for 2020? thanks! :)
@kvetoslavnovak423
@kvetoslavnovak423 6 жыл бұрын
Great video and tips as always, Scott!!! Would it be posdible to share you advice regarding sharing code between React and React Native Apps using Meteor and Apollo/GraphQL? Thank you in advance!
@a76i37
@a76i37 3 жыл бұрын
Very Helpful Thanks
@garfieldJian
@garfieldJian 5 жыл бұрын
lol, your video is so clear. love it
@roeelcohen
@roeelcohen 5 жыл бұрын
What's your theme??
@maxabzaloff6164
@maxabzaloff6164 6 жыл бұрын
Hello! I have only one question - what IDE theme do you use? thanx
@syntaxfm
@syntaxfm 6 жыл бұрын
Level Up official
@soufianeibnouine
@soufianeibnouine 4 жыл бұрын
I like the theme of your text editor :)
@KidJV
@KidJV 3 жыл бұрын
3:40 short-hand is good but bad for readability i still use the long-hand one
@Ecdetails
@Ecdetails 6 жыл бұрын
Hey sir what theme are you using and is it vscode? Also thanks for an amazing g course
@syntaxfm
@syntaxfm 6 жыл бұрын
Level Up Official for VSCode.
@Ecdetails
@Ecdetails 6 жыл бұрын
Just downloaded it, and man is it SWEET easy to see love it thanks sir
@khamdamov
@khamdamov 6 жыл бұрын
I came here to say thank you for your amazing official theme for VSCode.
@SunilKumar-fh6jk
@SunilKumar-fh6jk 6 жыл бұрын
whats the name of the theme?
@iblockdev7342
@iblockdev7342 6 жыл бұрын
Sunil Kumar level up official
@alimorshidi9419
@alimorshidi9419 5 жыл бұрын
What editor you use?
@aWiseCoder
@aWiseCoder 5 жыл бұрын
visual studio code
@jboxy
@jboxy 5 жыл бұрын
Use them arrow methods to auto reference this, .eslint to 2018. Really you don't need classes if you use state going with function hooks
@haroldpepete
@haroldpepete 3 жыл бұрын
Fragment short syntax doesn't work well with key keyword, if you need key in fragment you can't use fragment short syntax
@andreivedovato
@andreivedovato 6 жыл бұрын
But can't you export like: "export Test extends...." and then import it like "import { Test } from ..."?
@syntaxfm
@syntaxfm 6 жыл бұрын
Yep! Any valid import / export. The point is that the error in React won't always tell you the issue is with your import.
@leelandmill
@leelandmill 6 жыл бұрын
He kinda showed that in the video right at about 9:00.
@andreivedovato
@andreivedovato 6 жыл бұрын
yea, kinda :p
@himanshupratap29
@himanshupratap29 6 жыл бұрын
Thank You !
@miketkachenko5939
@miketkachenko5939 5 жыл бұрын
Cool video, ty.
@WebDevProfesh
@WebDevProfesh 6 жыл бұрын
You can also import {Fragment} from ‘react’
@aurelianspodarec2629
@aurelianspodarec2629 6 жыл бұрын
WHy all the extra hassle? React.Fragment is just fine.
@ZakiWasik
@ZakiWasik 5 жыл бұрын
Don't think it's a hazzle at all. You have to type "Fragment" once more, but saves writing "React." twice. Besides that I think it looks much cleaner and easier to the eye to have a tag than a .
@kanonbolt100
@kanonbolt100 5 жыл бұрын
You can actually just use now for fragment
@osamaayub6004
@osamaayub6004 Жыл бұрын
​@@kanonbolt100 yes this works fine
@Zzzzzzzzzzzzzzzzzzzzr
@Zzzzzzzzzzzzzzzzzzzzr 6 жыл бұрын
class app extends React.Component but I see you have export is that the es2015 style
@syntaxfm
@syntaxfm 6 жыл бұрын
What is the "es2015 style" export you are referring to?
@zacktonature
@zacktonature 5 жыл бұрын
This is not really related to React, but more to VS Code. At 4:10 when you're making the this.setState({ open: true }) you write ({open: true}) and then it spaces it out automatically. What's the setting or keyboard shortcut to do this? Would save me a ton of time and I'm not even sure what to google. Besides my VS Code question, I want to thank you for making this video! I'm only a week into React and this has really helped me out.
@yuyutsu
@yuyutsu 5 жыл бұрын
I am not sure but most probably it is a package called 'prettier'.
@zacktonature
@zacktonature 5 жыл бұрын
Adam Wall New in general. I've been learning JS for about ~2 months now and feel confident enough to start learning React and then RN.
@BarryMichaelDoyle
@BarryMichaelDoyle 6 жыл бұрын
Your runFunc arrow function isn't very performant (I know it's very clean But it has the same performance issues as having a callback function in the render). The most performant is the bind the function in the component constructor :)
@syntaxfm
@syntaxfm 6 жыл бұрын
What are the numbers like between the two? Is it an optimization or a micro optimization? I personally use class properties myself, but will still use an arrow function in the even from time to time. I doubt it's an optimization that makes a huge difference in most cases.
@jeytii
@jeytii 6 жыл бұрын
Am I no longer a beginner if I'm not struggling with those problems you mentioned? ^_^
@alexmachin1785
@alexmachin1785 6 жыл бұрын
#ReactExpert lol
@quigley61
@quigley61 6 жыл бұрын
To the point, how it should be!
@jameskobe1716
@jameskobe1716 5 жыл бұрын
What's the name of your theme ? I'm colorblind and this looks nice :)
@jameskobe1716
@jameskobe1716 5 жыл бұрын
🐈
@faahkoo
@faahkoo 6 жыл бұрын
One time I wrapped a component with Fragment and I had a big issue, React Router Dom crashed in production build because of it (Seems like it doesn't render a container/components very well in this case) hahaha, since than I started using my own HOC to make it happen
@lewis6590
@lewis6590 5 жыл бұрын
nice video, but... are these really beginner problems?! if so then i guess i am a beginner... but surely a beginner would just wrap everything in a div and live in blissful ignorance of new React features?
@emredikmen276
@emredikmen276 5 жыл бұрын
visual studio code theme pls
@yuyutsu
@yuyutsu 5 жыл бұрын
Level Up Theme Official
@angeldiapernashik
@angeldiapernashik 6 жыл бұрын
Great day
@k4l4sh77
@k4l4sh77 5 жыл бұрын
Import/export explained stackoverflow.com/questions/36795819/when-should-i-use-curly-braces-for-es6-import/36796281#36796281
@ankurleonardo
@ankurleonardo 6 жыл бұрын
Hi Dude! This is probably going to be the biggest drawback for React that I have been seen a hell of a change from initial react version to latest React version. The moment you choose to work on the current version, finish the project in a couple of months, BOOM! you are outdated..lol
@syntaxfm
@syntaxfm 6 жыл бұрын
None of it is meaningless change though. React is constantly improving and that part of the benefits of using it.
@Denvercoder
@Denvercoder 6 жыл бұрын
No other option is any better. I started learning Angular 2 like 1 year ago and now they are about to release Angular 6. 😜
@mykelchang846
@mykelchang846 5 жыл бұрын
@@Denvercoder Angular 7 is out :p
@wixnarara
@wixnarara 5 жыл бұрын
Vue never had this issue ;) One of the reasons why I love it
@davidsoto8445
@davidsoto8445 6 жыл бұрын
Niiice
@jaycobbs
@jaycobbs 6 жыл бұрын
Or instead of
@syntaxfm
@syntaxfm 6 жыл бұрын
returning an Array was an older and IMO less elegant solution especially compared to the syntax.
@Daijyobanai
@Daijyobanai 6 жыл бұрын
had better come with a comment explaining it or else *someone* will delete it down the line. I prefer to be explicit so would go with as it looks like it is meant to be there!
@shilangyu
@shilangyu 6 жыл бұрын
not only returning an array is uglier but also it forces you to have a key property on all children. Not recommended
@pianowhizz
@pianowhizz 5 жыл бұрын
@@Daijyobanai Code is for humans, not machines. You should be able to type but your IDE or WebPack should automatically replace those with prior to git commit :)
@HDChif
@HDChif 6 жыл бұрын
IMO implementing Redux is about the same amount of effort than the Context API.. And once you get the hang of it, it is always the same and you get quicker and quicker
@andreivedovato
@andreivedovato 6 жыл бұрын
agreed
@hughmann9097
@hughmann9097 3 жыл бұрын
React feels like one giant workaround sitting on top of workarounds. Why would anyone use this?
@hhskladby1596
@hhskladby1596 3 жыл бұрын
Well documented and consistent workarounds are a more maintainable help than smart ass code golfings.
@yairvsync
@yairvsync 5 жыл бұрын
so annoying JSX doesn't add a wrapper automatically (for multiple child nodes) There's pre-processing going on anyway so why not make it a bit smarter..
@thedevhassan
@thedevhassan 3 жыл бұрын
🐁
How To Debug React Apps Like A Senior Developer
21:07
Web Dev Simplified
Рет қаралды 56 М.
React JS Explained In 10 Minutes
10:00
Dennis Ivy
Рет қаралды 255 М.
Red❤️+Green💚=
00:38
ISSEI / いっせい
Рет қаралды 76 МЛН
KINDNESS ALWAYS COME BACK
00:59
dednahype
Рет қаралды 164 МЛН
Top 10 CSS One Liners That Will Blow Your Mind
13:34
developedbyed
Рет қаралды 926 М.
JavaScript Pro Tips - Code This, NOT That
12:37
Fireship
Рет қаралды 2,5 МЛН
Redux For Beginners | React Redux Tutorial
39:43
developedbyed
Рет қаралды 1,2 МЛН
VICKY KAUSHAL REACTS TO VICKY KAUSHAL MEMES ft. VICKY KAUSHAL
26:42
Tanmay Bhat
Рет қаралды 5 МЛН
Context API in react | get the concept
29:00
Hitesh Choudhary
Рет қаралды 47 М.
5 React Native Tips to WOW Your Users
16:36
Simon Grimm
Рет қаралды 16 М.
Compound Components in React (Design Patterns)
18:21
Cosden Solutions
Рет қаралды 31 М.
How to learn react | A react Roadmap
19:18
Hitesh Choudhary
Рет қаралды 34 М.
React Tutorial for Beginners
1:20:04
Programming with Mosh
Рет қаралды 2,8 МЛН
Grandma Cat - the Hot Dog Eating Champion #gaming #food #challenge  #cartoon
0:15
Super Emotional Stories
Рет қаралды 12 МЛН
Pov Anxiety made an unfortunate  prank | Inside Out 2
0:23
MiNiKa YT
Рет қаралды 9 МЛН