Sharing Top Content from the Angular-sphere.

A Simple React.js Lesson – JavaScript Teacher – Medium

  • A Simple React.js LessonThis is for absolute beginner who is still indecisive about React.YouTube video [6m:11s] for this tutorial is available here: React JS Tutorial 2In React, primary element is ReactElement.
  • Or the common denominator of your program structure.Create React Element without JSX:var P = React.createElement(‘p’, {className: ‘cN’}, ‘TXT’);Now create same React Element with JSX:var P = p className=“cN”TXT/pLooks a lot simpler with JSX.The latter will be automatically converted to ReactElement anyways.Congratulations!
  • You just created a virtual DOM element in React.Regardless of how the ReactElement was created, render it as:var root = root);This will “mount” your new HTML element to the JavaScript DOM.The element will be rendered into the app container whose id is root:div id = “AppContainer”/div

This is for absolute beginner who is still indecisive about React. “A Simple React.js Lesson” is published by JavaScript Teacher

@js_tut: I just published “A Simple React.js Lesson” #reactjs #javascript #angularjs #vuejs #webdev #fullstack #frontend

This is for absolute beginner who is still indecisive about React.

YouTube video [6m:11s] for this tutorial is available here: React JS Tutorial 2

In React, primary element is ReactElement. It’s the building block. Or the common denominator of your program structure.

Create React Element without JSX:

var P = React.createElement(‘p’, {className: ‘cN’}, ‘TXT’);

Now create same React Element with JSX:

Looks a lot simpler with JSX.

The latter will be automatically converted to ReactElement anyways.

Congratulations! You just created a virtual DOM element in React.

Regardless of how the ReactElement was created, render it as:

var root = document.getElementById(“AppContainer”);

React.render(P, root);

This will “mount” your new HTML element to the JavaScript DOM.

The element will be rendered into the app container whose id is root:

A Simple React.js Lesson – JavaScript Teacher – Medium

Comments are closed, but trackbacks and pingbacks are open.