JavaScript for React
Short read before you began with react ; It will be helpful :)
Keyword
Understanding scope of keyword and what was ES’6 has to offer !
Objects
key : value pair
This
standalone object
see this code and run in your machine ; note reference() is standalone object and will refer window object.
In ‘Strict Mode’ it will be undefined.
bind()
Functions in javascript are Object.
Fat Arrow =>
Many Benefits ; one is make code cleaner.
Fat Arrow and this (Together in Consideration)
See the Snippet carefully and read the commented lines.
Map Function
Map function is very important function will render in react.
Object Destructing
Make big project readable :)
Spread
Use to clone object and array.
Class
this is similar to like any other programming language.
Note: Name of class should begin with Upper Case
Inheritance
Again same as other programming language.
Access Specifier
normally the class are private until you export them in React.
There are two types of export
- named
example :- import {ClassName}from ‘./path’; - default
example :- import ClassName from ‘./path’;
because in default we do export default ClassName;
Conclusion
Hope this help,Code explains better than word.
Happy Learning and code for good !
