Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Modern JavaScript in React Documentation

If you haven’t worked with JavaScript in the last few years, these three points should give you enough knowledge to feel comfortable reading the React documentation:

  • We define variables with let and const statements. For the purposes of the React documentation, you can consider them equivalent to var.
  • We use the class keyword to define JavaScript classes. There are two things worth remembering about them. Firstly, unlike with objects, you don't need to put commas between class method definitions. Secondly, unlike many other languages with classes, in JavaScript the value of this in a method depends on how it is called.
  • We sometimes use => to define "arrow functions". They're like regular functions, but shorter. For example, x => x * 2 is roughly equivalent to function(x) { return x * 2; }. Importantly, arrow functions don't have their own this value so they're handy when you want to preserve the this value from an outer method definition.

Don't worry if this is too much to take in at once. The MDN JavaScript Reference is a stellar resource, and you can consult it whenever you get confused by something.

Also, when you feel unsure about what some newer syntax means, you can use the Babel REPL with the ES2015 preset to check what equivalent older syntax it compiles to.

@franckycodes
Copy link

franckycodes commented Nov 5, 2021

thank you

@mrcreamio
Copy link

mrcreamio commented Dec 17, 2021

awesome 👍

@CodeHore
Copy link

CodeHore commented Dec 24, 2021

I rarely comment on documentation (usually, I figure it is my ignorance, keeping me from understanding); however, the link in the following part of the post doesn't load "Babel"...perhaps the link needs to be adjusted?

Also, when you feel unsure about what some newer syntax means, you can use the Babel REPL with the ES2015 preset to check what equivalent older syntax it compiles to.

@maheshareddy
Copy link

maheshareddy commented Jan 12, 2022

To the point. awesome!

@subrat0796
Copy link

subrat0796 commented Jan 21, 2022

To the point !!
Thanks a lot !!

@mishrasur7
Copy link

mishrasur7 commented Jan 22, 2022

Helpful!

@tegbuna
Copy link

tegbuna commented Jan 24, 2022

TYVM!

@Proshach
Copy link

Proshach commented Jan 25, 2022

Thank you !

@Srikantha2001
Copy link

Srikantha2001 commented Feb 2, 2022

Thanks a Lot

@safashuvo
Copy link

safashuvo commented Feb 12, 2022

Thanks

@shirgans
Copy link

shirgans commented Feb 14, 2022

Thanks! makes a lot of logic now to read react code

@studiovoyager
Copy link

studiovoyager commented Feb 16, 2022

What a great idea with the 3 points. thanks so much!

@hygull
Copy link

hygull commented Mar 2, 2022

Cool stuffs. Appreciate it.

@iqbalhussainAtSHO
Copy link

iqbalhussainAtSHO commented Mar 3, 2022

THANK YOU!

@rexla
Copy link

rexla commented Mar 16, 2022

Thanks!

@maudmcok
Copy link

maudmcok commented Mar 22, 2022

Thanks!

@NMRayhan
Copy link

NMRayhan commented Mar 23, 2022

Thanks to author and It's a very effective blog for some people who Doesn't practice last few years

@kurulerdem
Copy link

kurulerdem commented Mar 25, 2022

Thank u 👍

@fhusain07
Copy link

fhusain07 commented Apr 6, 2022

So Informative .....

@HonestDev0926
Copy link

HonestDev0926 commented Apr 9, 2022

Very good simple helpful resource!

@Pratik-A-N
Copy link

Pratik-A-N commented Apr 15, 2022

Thank You!

@macia-app
Copy link

macia-app commented Apr 15, 2022

Gracias!!

@prakasa-tkpd
Copy link

prakasa-tkpd commented May 13, 2022

Thank You!

@sabuein
Copy link

sabuein commented May 18, 2022

Thank you.

@Poshqed
Copy link

Poshqed commented May 31, 2022

Many Thanks!

@barayiti
Copy link

barayiti commented Jun 6, 2022

Thank you

@KadirYurekturk
Copy link

KadirYurekturk commented Jun 8, 2022

Thank you for info. And for showing me that I'm not alone :)

@syaiful-scooter
Copy link

syaiful-scooter commented Jun 9, 2022

Thank you for info. And for showing me that I'm not alone :)

so do i :)

@Jacobkyalo
Copy link

Jacobkyalo commented Jun 11, 2022

This is cool!

@imPrajwalKadam
Copy link

imPrajwalKadam commented Jun 19, 2022

Thank You.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment