Some Basics React.js Beginners Should Know

Some Basics #Reactjs Beginners Should Know by @iAnkurMishra cc @CsharpCorner  #JavaScript

  • Always keep this thing in mind, else, you will end-up with your awesome react code.
  • Always make your components as small as possible.
  • The article tells how this will give you a head start on React.
  • The answer is we all know about Flux.
  • There are two types to define React components.

In this article, you will learn about some basics about React.js beginners should know.

@CsharpCorner: Some Basics #Reactjs Beginners Should Know by @iAnkurMishra cc @CsharpCorner #JavaScript

Some Basics React.js Beginners Should Know

 

 

 

 

 

C# Corner

In Focus LEARN: How to become a Microsoft MVP

DOWNLOAD: C# Corner Android App Version 0.5.3 Released

C# Corner Annual Conference 2017 Announced

C# Corner

Contribute An Article

A Blog

A News

A Video

A Link

An Interview Question

Ask a Question

 

TECHNOLOGIES .NET Cloud iOS Oracle String in C#

.NET Core Cognitive Services Java Outsourcing Swift

ADO.NET Cryptography JavaScript PHP TypeScript

AJAX Current Affairs JQuery Power BI Universal Windows Platform

Android Databases & DBA JSON Products Visual Studio

Angular 2 Design Patterns & Practices JSP Project Management VR and AR

AngularJS Dynamics CRM Knockout Python WCF

Architecture Entity Framework Learn C# Corner R Web Development

ASP.NET Error Zone LINQ Robotics & Hardware Web Services

ASP.NET Core Expression Studio Machine Learning Security Windows 10

Azure Games Programming Microsoft Office Servers Windows Controls

Big Data GDI+ & Graphics Mobile Development SharePoint Windows Forms

BizTalk Server Google Development Multithreading SignalR Windows PowerShell

Bot Framework HoloLens Node.js Smart Devices WPF

C# How do I Office Development Software Testing Xamarin

C, C++, MFC HTML 5 OOP/OOD SQL Language XAML

Career Advice Internet & Web Open Source SQL Server XML

Chapters Internet of Things Operating Systems

Request a new Category | View All

ANSWERS

BLOGS

VIDEOS

INTERVIEWS

BOOKS

NEWS

CHAPTERS

CAREER

Jobs

CODE

IDEAS

Scroll To Top

Reader Level:

Article

Some Basics React.js Beginners Should Know

By Ankur Mishra on Oct 06, 2016

In this article, you will learn about some basics about React.js beginners should know.

1.5k

0

0

facebook

twitter

linkedIn

google Plus

Reddit

WhatsApp

expand

React.Js is an emerging programming concept for developers. This is the language, which makes difficult things easy, but sometimes it make easy things difficult, which happens by using simple jQuery or JavaScript. Many documentations are available online, using which you can set your environment and can start working with React.JS but before starting big things, you have to know some basics. I learned some React.JS and am sharing my points, given below-

First thing you have to be clear about is that  React.JS is not an MVC Framework or any other kind of framework. React JS is just a library, which renders your views. If you are a MVC guy, you should only have in your mind ‘V’ – Views, nothing else. Thus, always keep this thing in mind, else, you will end-up with your awesome react code.

Second thing, you have to be clear on your all components. Always make them small. This is simple and easy to understand. Thus, always make your components as small as possible.

Example

Here, I have created a carousel for my Testimonial section, which isa  simple and small component.

can be used with only one rendering element .

We should write the functional components. There are two types to define React components.

ES6 Class can be used, which is given below-

React.createClass() is used, which is given below-

Now, new update React 0.14 has new ways to define the components, which are given below-

Most important thing is we should always use propTypes. At the time of development, when you require a Prop, it will show an error and will benefit you, as it catches bugs by preventing silly mistakes. Use of isRequired makes you free from the bugs like undefined or null.

PropTypes looks, as shown below-

The main and only React specific thing is JSX. JSX is a no-brainer over manually calling React.createElement. Use of this gives you a disadvantage – it will add some amount of build time complexity.

This will be solvable using Babel.

ES6 features are also important like constants, arrow functions, default arguments, array and object destructuring, spread and rest operators, string interpolation, iterators and generators, a decent module system etc.

We round things out with Webpack for bundling our code, NPM for package management and we’re now fully using JavaScript buzzword compliant 🙂

React DEV tools are awesome. We can set up the hot module replacement with Webpack, so that our page updates, as soon as we save our code and no Browser refresh is required.

In the points mentioned above, I have discussed about ‘V’- views, so the question is where will we  put our state and logic? Thus, the answer is we all know about Flux.

Flux is a style for designing the Web Applications. Thus, for the same thing, we’ll use Redux.JS.

You can learn more about Flux and about Redux.JS.

Thus, this article tells how this will give you a head start on React. Follow the rules/ tricks, tips and create your React Application.

JavaScript Some Basics React.js

Trending up

01 Using Generics With C#

02 Web Crawling With C#

03 Best Practices For ASP.NET MVC Application

04 What Is The Future Of XAML

05 C# Version 7.0 Announcements

06 Best Programming Language Of 2016

07 Introduction To .NET Core 1.0

08 Factory Design Pattern Real World Example

09 Highest Paying Tech Jobs Of 2016

10 How To Become A Microsoft MVP

View All

Follow @twitterapi

MVPs

MOST VIEWED

LEGENDS

NOW

PRIZES

REVIEWS

SURVEY

DOWNLOADS

Hosted By CBeyond Cloud Services

ABOUT US

FAQ

MEDIA KIT

MEMBERS

STUDENTS

LINKS

CONTACT US

PRIVACY POLICY

TERMS & CONDITIONS

SITEMAP

REPORT A BUG

facebook

twitter

google

media

©2016 C# Corner. All contents are copyright of their authors.

Contact Us

Privacy Policy

Terms & Conditions

About Us

©2016 C# Corner. All contents are copyright of their authors.

Some Basics React.js Beginners Should Know