{"id":2552,"date":"2018-10-20T09:31:20","date_gmt":"2018-10-20T09:31:20","guid":{"rendered":"https:\/\/tinjurewp.com\/jsblog\/?p=2552"},"modified":"2018-10-20T09:31:20","modified_gmt":"2018-10-20T09:31:20","slug":"learning-reactjs-a-basic-overview","status":"publish","type":"post","link":"https:\/\/learncode.tinjurewp.com\/learning-reactjs-a-basic-overview\/","title":{"rendered":"Learning ReactJs \u2013 A Basic Overview"},"content":{"rendered":"<p class=\"note icon-note\"><strong>Note<\/strong>: This post is work-in-progress learning-note and still in active development and updated regularly.<\/p>\n<p>After React development environment setup, I wanted to dig into React world. React API is known as most popular JavaScript (JS) library to allow developers to build interactive user interfaces for webs.<\/p>\n<blockquote><p>Build encapsulated components that manage their own state, then compose them to make complex UIs.<cite> <a href=\"https:\/\/reactjs.org\/\" target=\"_blank\" rel=\"noopener\">React Website<\/a><\/cite><\/p><\/blockquote>\n<p>Before deep diving into React, I wanted have a quick overview of React&#8217;s component-based structure first, just enough to getting started. Main purpose of this introductory learning-note post is to get familiar with basic <a href=\"https:\/\/reactjs.org\/docs\/glossary.html\" target=\"_blank\" rel=\"noopener\">ReactJs terminology<\/a> with an aim to understand workings of a React component enough to getting started with building basic react applications.<\/p>\n<h4><a href=\"https:\/\/reactjs.org\/docs\/faq-internals.html\" target=\"_blank\" rel=\"noopener\">React DOM &#8211; a Virtual DOM<\/a><\/h4>\n<p>It&#8217;s React way to using DOM as a virtual representation of UI &#8220;virtual DOM&#8221;, which is an abstraction of HTML <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Mozilla\/Tech\/XUL\/Tutorial\/Document_Object_Model\" target=\"_blank\" rel=\"noopener\">DOM<\/a>.Updating elements on DOM nodes involves using DOM UI. Frequent update of elements on node tree slows down element rendering on the DOM.<\/p>\n<p>React gets around this problem using virtual DOM, which is build on the top of the actual DOM. Most events updating in React occur in virtual DOM and utilize minimum use of HTML DOM. Events update from virtual DOM to actual occurs through <a href=\"https:\/\/reactjs.org\/docs\/reconciliation.html\" target=\"_blank\" rel=\"noopener\">reconciliation<\/a> and thus achieve faster and efficient implementation.<\/p>\n<p>Additional Resource: <a href=\"https:\/\/reactjs.org\/docs\/react-dom.html\" target=\"_blank\" rel=\"noopener\">React DOM<\/a><\/p>\n<h4><a href=\"https:\/\/reactjs.org\/docs\/glossary.html#elements\" target=\"_blank\" rel=\"noopener\">Elements<\/a><\/h4>\n<p>React elements are considered the building blocks of ReactJs and are returned using <code>render()<\/code> method to the viewing post (screen). The elements are immutable (can be modified). An example of react element:<\/p>\n<pre class=\"line-numbers\"><code class=\"language-javascript\">\/\/ react element\nconst element = &lt;h1&gt;Greetings, You are awesome!&lt;\/h1&gt;;<\/code><\/pre>\n<p>Additional information: <a href=\"https:\/\/reactjs.org\/docs\/rendering-elements.html\" target=\"_blank\" rel=\"noopener\">Rendering Elements<\/a><\/p>\n<h4>Using JSX<\/h4>\n<p>React uses <a href=\"https:\/\/reactjs.org\/docs\/introducing-jsx.html\" target=\"_blank\" rel=\"noopener\">JSX<\/a> (JavaScript XML) to\u00a0 describe user interface. Although React recommends using JSX, it is <em>optional and <a href=\"https:\/\/reactjs.org\/docs\/react-without-jsx.html\" target=\"_blank\" rel=\"noopener\">not required<\/a> to use React<\/em>.<\/p>\n<h6>1. Nested Elements in JSX<\/h6>\n<p>Nested elements should be wrapped inside a container wrapper.<\/p>\n<pre class=\"line-numbers\"><code class=\"language-javascript\">\/\/ nested wrapper in JSX\n&lt;div&gt;\n    &lt;h1&gt;Hello World!&lt;\/h1&gt;\n    &lt;h2&gt;Welcome to ReactJs app&lt;\/h2&gt;\n    &lt;p&gt;This is nested element use in JSX&lt;\/p&gt;\n&lt;\/div&gt;<\/code><\/pre>\n<p>In the example above, the <code>h1<\/code>, <code>h2<\/code> and <code>p<\/code> elements are wrapped with <code>div<\/code> element.<\/p>\n<p class=\"alert icon-alert\"><strong>Alert<\/strong>: If two JSX elements are used in a component to <em>return<\/em> elements, <a href=\"https:\/\/babeljs.io\/\" target=\"_blank\" rel=\"noopener\">Babel<\/a> compiler throws error. A <code>return()<\/code> method <em>returns<\/em> only single parent element.<\/p>\n<pre class=\"line-numbers\"><code class=\"language-javascript\">\/\/ use of nested sibling elements - throws error\nconst MyExample = () =&gt; {\n    return (\n       &lt;div&gt; Hello, World!&lt;\/div&gt;\n       &lt;div&gt; Hello, me again!&lt;\/div&gt;\n       )\n}\n\n\/\/babel transpile error\nrepl: Adjacent JSX elements must be wrapped in an enclosing tag (5:7)\n  3 |     return (\n  4 |        &lt;div&gt; Hello, World!&lt;\/div&gt;\n&gt; 5 |        &lt;div&gt; Hello, me again!&lt;\/div&gt;\n    |        ^\n  6 |        )\n  7 | }<\/code><\/pre>\n<p>When <a href=\"https:\/\/babeljs.io\/\" target=\"_blank\" rel=\"noopener\">Babel<\/a> transpiles a JSX tag it turns into a function and returns\u00a0 the result of <code>React.createElement()<\/code>. As we know <code>return<\/code> keyword serves as break point, it&#8217;s not allowed to have <strong>two<\/strong> <code>return<\/code> statements inside a component.<\/p>\n<p>Return JSX elements inside components must be wrapped within a single parent <code>div<\/code> as shown below:<\/p>\n<pre class=\"line-numbers\" data-start=\"17\"><code class=\"language-javascript\">\/\/ Babel transpiles WITHOUT error\nconst MyExample = () =&gt; {\n    return (\n     &lt;div&gt;\n       &lt;div&gt; Hello, World!&lt;\/div&gt;\n       &lt;div&gt; Hello, me again!&lt;\/div&gt;\n    &lt;\/div&gt;\n       )\n}<\/code><\/pre>\n<p class=\"note icon-note\"><strong>Tip<\/strong>: When in doubt using JSX inside <code>render()<\/code> method, wrap all elements inside a single <code>div<\/code> element.<\/p>\n<p><strong>2. HTML Attributes in JSX<\/strong><\/p>\n<p>React DOM supports <a href=\"https:\/\/reactjs.org\/docs\/dom-elements.html#all-supported-html-attributes\" target=\"_blank\" rel=\"noopener\">standard or custom DOM attributes<\/a> with or without <code>data-<\/code> prefix attributes. Using the examples from <a href=\"https:\/\/reactjs.org\/blog\/2017\/09\/08\/dom-attributes-in-react-16.html#data-and-aria-attributes\" target=\"_blank\" rel=\"noopener\">React Documentation<\/a>:<\/p>\n<pre class=\"line-numbers\"><code class=\"language-javascript\">\/\/example from React Documentation\n&lt;div tabIndex=&quot;-1&quot; \/&gt;      \/\/ Just like node.tabIndex DOM API\n&lt;div className=&quot;Button&quot; \/&gt; \/\/ Just like node.className DOM API\n&lt;input readOnly={true} \/&gt;  \/\/ Just like node.readOnly DOM API\n\n\/\/use of data attributes\n&lt;div data-foo=&quot;42&quot; \/&gt;\n&lt;button aria-label=&quot;Close&quot; onClick={onClose} \/&gt;<\/code><\/pre>\n<p>Addition Information: <a href=\"https:\/\/reactjs.org\/docs\/dom-elements.html\" target=\"_blank\" rel=\"noopener\">React DOM Elements<\/a><\/p>\n<p><strong>3. Use of JS Expression in JSX<\/strong><\/p>\n<p>JS expression can be used in JSX but the expression should be wrapped within <code>{ }<\/code> curly brackets.<\/p>\n<pre class=\"line-numbers\"><code class=\"language-javascript\">\/\/ ES6 syntax\nconst MyExample = () =&gt; {\n    let name = &quot;Toyota&quot;\n    return (\n       &lt;h1&gt; I drive {name}&lt;\/h1&gt;\n       )\n}<\/code><\/pre>\n<p>In the example above, simple JS expression <code>name = &quot;Toyota&quot;<\/code> (line 3) is wrapped with curly braces <code>{ }<\/code> in\u00a0 JSX (line 5).<\/p>\n<p>Addition information: <a href=\"https:\/\/reactjs.org\/docs\/introducing-jsx.html#embedding-expressions-in-jsx\" target=\"_blank\" rel=\"noopener\">Embedding expression in JSX<\/a><\/p>\n<p><strong>4. Comments in JSX<\/strong><\/p>\n<p>HTML comments can&#8217;t be used in JSX. The following HTML comment (line 5) throws error.<\/p>\n<pre class=\"line-numbers\"><code class=\"language-javascript\">\/\/ HTML comments throws error\nrender() {\n  return (\n    &lt;div&gt;\n      &lt;!-- This doesn&#039;t work! --&gt;\n       &lt;h1&gt;Hello World!&lt;\/h1&gt;\n    &lt;\/div&gt;\n  )\n}<\/code><\/pre>\n<p>In JSX regular JS block comments <code>\/* JS block comment *\/<\/code> can be used but they need to be wrapped with curly brackets <code>{ }<\/code> as shown below:<\/p>\n<pre class=\"line-numbers\"><code class=\"language-javascript\">\/\/ single line JSX comment\n{\/* A single line JSX comment *\/}\n\n\/\/Multi-line JSX comments\n{\/* Multi-line comments\n in JSX looks\nlike this example\n*\/}<\/code><\/pre>\n<p><strong>5. Inline Styling in JSX<\/strong><\/p>\n<p>Inline style can be added to React App by combining CSS style with JSX as shown in the example below:<\/p>\n<pre class=\"line-numbers\"><code class=\"language-javascript\">\/* inline styling *\/\nclass HelloWorld extends React.Component{\n   render() {\n    {\/* inline style *\/}\n    var addStyle = {\n         fontSize: 40,\n         fontWeight: bold,\n         color: &#039;#0080ff&#039;\n      }\n\n      return &lt;div&gt;\n        &lt;h1 style = {addStyle}&gt;Hello World!&lt;\/h1&gt;\n        &lt;p&gt;This is simple React Component&lt;\/p&gt;\n        &lt;\/div&gt;\n      }\n}<\/code><\/pre>\n<p>The <code>&lt;strong&gt;camelCase&lt;\/strong&gt;<\/code> naming convention is used in CSS syntax, <code>px<\/code> value will be automatically added by React after appropriate value in an element. In the above example <code>addStyle<\/code> (lines: 5-9) is used to inline styling of <code>h1<\/code> element (line 12).<\/p>\n<p>Note: To quote from the <a href=\"https:\/\/reactjs.org\/docs\/dom-elements.html\" target=\"_blank\" rel=\"noopener\">React Documentation<\/a>: &#8220;Since JSX is JavaScript, identifiers such as <b>class<\/b> and <b>for<\/b> are discouraged as XML attribute names. Instead, React DOM components expect DOM property names such as <b>className<\/b> and <b>htmlFor<\/b>, respectively&#8221;.<\/p>\n<p>Additional information: <a href=\"http:\/\/DOM Elements\" target=\"_blank\" rel=\"noopener\">DOM Elements<\/a><\/p>\n<h4><a href=\"https:\/\/reactjs.org\/docs\/components-and-props.html\" target=\"_blank\" rel=\"noopener\">Components<\/a><\/h4>\n<p>In React World, everything is component which are essentially JS functions and Classes. To quote from <a href=\"https:\/\/reactjs.org\/docs\/glossary.html#components\" target=\"_blank\" rel=\"noopener\">React Document<\/a> &#8220;<em>React components are small, reusable pieces of code that return a React element to be rendered to the page<\/em>&#8220;.<\/p>\n<p>Its a general convention to start <em>first<\/em> letter of component names with capital letter. React components can be group into <a href=\"https:\/\/reactjs.org\/docs\/components-and-props.html#function-and-class-components\" target=\"_blank\" rel=\"noopener\">Functional and Class components<\/a>.<\/p>\n<h6 id=\"functional-component\">1. <a href=\"https:\/\/reactjs.org\/docs\/components-and-props.html#function-and-class-components\" target=\"_blank\" rel=\"noopener\">Functional component<\/a><\/h6>\n<p>The functional components is the classic JS function which accepts single property (referred as &#8220;<em>props<\/em>&#8221; in react) object argument with some data and returns JSX element.<\/p>\n<pre class=\"line-numbers\"><code class=\"language-javascript\">\/\/functional component\nconst Greeting = () =&gt; { \n    return &lt;h1&gt;Greeting, You look awesome!&lt;\/h1&gt;;\n}\n\n\/\/ stateless component\nfunction Welcome(props) {\n  return &lt;h1&gt;Hello, {props.name}&lt;\/h1&gt;;\n}<\/code><\/pre>\n<p>Functional components are referred as &#8220;<strong><em>stateless<\/em><\/strong>&#8221; component because they lack <a href=\"https:\/\/reactjs.org\/docs\/state-and-lifecycle.html\" target=\"_blank\" rel=\"noopener\">state &amp; life cycle methods<\/a> is not aware of any of its own state. Its main purpose to receive data and present as JSX. Their main objective is &#8220;<em>presentational<\/em>&#8220;, <em>i.e.<\/em> to alter the UI.<\/p>\n<p>The stateless components are simple, easy to write &amp; understand and recommended to use when there is no need to use state or life cycle methods. They are suitable to build presentational components.<\/p>\n<h6>2. <a href=\"https:\/\/reactjs.org\/docs\/components-and-props.html#function-and-class-components\" target=\"_blank\" rel=\"noopener\">Class Components<\/a><\/h6>\n<p>React class components, unlike functional components, are aware of its state such as user responses (clicking a button or entering data etc).<\/p>\n<p>Class-based components are basically JS classes and which extends <code>React.component<\/code> and uses <code>render()<\/code> method (a required method) to return JSX.<\/p>\n<pre class=\"line-numbers\"><code class=\"language-javascript\">\/\/ using class component\nclass Greeting extends React.Component {\n  render(){\n    return &lt;h1&gt;Greeting, You are awesome!&lt;\/h1&gt;;\n  }\n}\n\n\/\/ ES6 Classes component\nclass Welcome extends React.Component {\n  render() {\n    return &lt;h1&gt;Hello, {this.props.name}&lt;\/h1&gt;;\n  }\n}<\/code><\/pre>\n<p>In the example above, the\u00a0 return statements (lines: 4 &amp; 11) are in one line and thus does not require a parentheses. In react world, the above two methods are equivalent.<\/p>\n<p>Class-based components are referred as &#8220;<strong><em>stateful<\/em><\/strong>&#8221; because they contain additional <a href=\"https:\/\/reactjs.org\/docs\/state-and-lifecycle.html\" target=\"_blank\" rel=\"noopener\">state &amp; life cycle methods<\/a>. In a typical class-based component, its state consists of <a href=\"https:\/\/reactjs.org\/docs\/state-and-lifecycle.html#adding-local-state-to-a-class\" target=\"_blank\" rel=\"noopener\">class constructor<\/a> method, <code>&lt;a href=&quot;https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Classes#Super_class_calls_with_super&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;super&lt;\/a&gt;<\/code> class inside the <code>&lt;a href=&quot;https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Classes#Constructor&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;constructor&lt;\/a&gt;<\/code> method.<\/p>\n<p>An example of class-based component from <a href=\"https:\/\/reactjs.org\/docs\/state-and-lifecycle.html#adding-local-state-to-a-class\" target=\"_blank\" rel=\"noopener\">React Guide<\/a>:<\/p>\n<pre class=\"line-numbers\"><code class=\"language-javascript\">\/\/example from React guide\nclass Clock extends React.Component {\n  constructor(props) {\n    super(props);\n    this.state = {date: new Date()};\n  }\n\n  render() {\n    return (\n      &lt;div&gt;\n        &lt;h1&gt;Hello, world!&lt;\/h1&gt;\n        &lt;h2&gt;It is {this.state.date.toLocaleTimeString()}.&lt;\/h2&gt;\n      &lt;\/div&gt;\n    );\n  }\n}<\/code><\/pre>\n<p>A class-based component has state, life cycle methods, and\u00a0 every time React renders it creates an instance of a class component.<\/p>\n<p>Additional Information: <a href=\"https:\/\/reactjs.org\/docs\/components-and-props.html#function-and-class-components\" target=\"_blank\" rel=\"noopener\">Components and props<\/a> &amp; <a href=\"https:\/\/github.com\/uberVU\/react-guide\/blob\/master\/props-vs-state.md#should-this-component-have-state\" target=\"_blank\" rel=\"noopener\">Should this Component have state?<\/a><\/p>\n<p>More detail discussion on <a href=\"https:\/\/reactjs.org\/docs\/components-and-props.html#rendering-a-component\" target=\"_blank\" rel=\"noopener\">rendering a component<\/a>, working example of a<a href=\"https:\/\/reactjs.org\/docs\/components-and-props.html#composing-components\" target=\"_blank\" rel=\"noopener\"> component<\/a>, and <a href=\"https:\/\/reactjs.org\/docs\/components-and-props.html#extracting-components\" target=\"_blank\" rel=\"noopener\">extracting a component<\/a> will be discussed separately.<\/p>\n<h4><a href=\"https:\/\/reactjs.org\/docs\/components-and-props.html\" target=\"_blank\" rel=\"noopener\">Props<\/a> and <a href=\"https:\/\/reactjs.org\/docs\/state-and-lifecycle.html#adding-local-state-to-a-class\" target=\"_blank\" rel=\"noopener\">State<\/a><\/h4>\n<p>The <a href=\"https:\/\/reactjs.org\/docs\/glossary.html#props\" target=\"_blank\" rel=\"noopener\">React document<\/a> describes <code>&lt;strong&gt;props&lt;\/strong&gt;<\/code> as &#8221; <em>inputs to a React component. They are data passed down from a parent component to a child component<\/em>.&#8221;<\/p>\n<h6>Props<\/h6>\n<p>Props are immutable (read-only) object properties of component (functional or a class) which are displayed in DOM with render() method in JSX element.<\/p>\n<p><em>Props<\/em> are passed from from one component to another, say from parent components to child component (one directional flow from top to down). Example of <em>props<\/em> data include data, callback function.<\/p>\n<p>Once received by components they must never be modified or changed. The following <a href=\"https:\/\/reactjs.org\/docs\/components-and-props.html#props-are-read-only\" target=\"_blank\" rel=\"noopener\">example snippets adapted from the React<\/a>:<\/p>\n<pre class=\"line-numbers\"><code class=\"language-javascript\">\/\/function component\nfunction add(x, y) {\n  return x + y;\n}\n\/\/mutable (impure) function\nfunction substract(account, amount) {\n  account.total -= amount;\n}<\/code><\/pre>\n<p>In the example above, the return value of <code>add()<\/code> function always remains the same for the same inputs and thus also called &#8220;<em>pure<\/em>&#8221; function. However, in the <code>substract()<\/code> function (lines: 6-8), the value of <code>account.total<\/code> changes. The props in React components must operate as pure (immutable) functions.<\/p>\n<h6>State<\/h6>\n<p>To quote from the React document, &#8220;<em>state is similar to props, but it is private and fully controlled by the component<\/em>&#8220;.<\/p>\n<p>The <em>state<\/em> object properties in React components are mutable, which means that state property value in response to user input or other responses.<\/p>\n<p>State is always a part of a React component (internal data of a class) and any data belonging the state effect only the components below. This process is commonly referred as &#8220;<em>top-down<\/em>&#8221; or &#8220;<em>unidirectional<\/em>&#8221; data flow.<\/p>\n<p>By default, React component has no state. The following example (used in earlier section) is stateless component:<\/p>\n<pre class=\"line-numbers\"><code class=\"language-javascript\">\/\/stateless component\nfunction Welcome(props) {\n  return &lt;h1&gt;Hello, {props.name}&lt;\/h1&gt;;\n}<\/code><\/pre>\n<p>If any React App such as clicking a button, or to do list etc needs to keep track of user responses then a state can be created to update and keep track of events.<\/p>\n<p>An <strong>use case example<\/strong> of how state in React component <em>ticking clock<\/em> from <a href=\"https:\/\/reactjs.org\/docs\/state-and-lifecycle.html\" target=\"_blank\" rel=\"noopener\">React guide<\/a> is available in <a href=\"https:\/\/codepen.io\/gaearon\/pen\/gwoJZk?editors=0010\" target=\"_blank\" rel=\"noopener\">CodePen<\/a>.<\/p>\n<p>Additional Information: <a href=\"https:\/\/reactjs.org\/docs\/state-and-lifecycle.html\" target=\"_blank\" rel=\"noopener\">State and Lifecycle<\/a>,\u00a0 and <a href=\"https:\/\/lucybain.com\/blog\/2016\/react-state-vs-pros\/\" target=\"_blank\" rel=\"noopener\">ReactJS: Props vs. State<\/a><\/p>\n<h6>Difference between Props and State<\/h6>\n<p>The difference between Props and State summarized in the following table is adapted from <a href=\"https:\/\/github.com\/uberVU\/react-guide\/blob\/master\/props-vs-state.md#props-vs-state\" target=\"_blank\" rel=\"noopener\">Props vs State<\/a> from React Guide GitHub pages.<\/p>\n<table class=\"learnjs\">\n<thead>\n<tr>\n<th>Description<\/th>\n<th>Props<\/th>\n<th>State<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Can get initial value from parent Component?<\/td>\n<td>Yes<\/td>\n<td>Yes<\/td>\n<\/tr>\n<tr>\n<td>Can be changed by parent Component?<\/td>\n<td>Yes<\/td>\n<td>No<\/td>\n<\/tr>\n<tr>\n<td>Can set default values inside Component?*<\/td>\n<td>Yes<\/td>\n<td>Yes<\/td>\n<\/tr>\n<tr>\n<td>Can change inside Component?<\/td>\n<td>No<\/td>\n<td>Yes<\/td>\n<\/tr>\n<tr>\n<td>Can set initial value for child Components?<\/td>\n<td>Yes<\/td>\n<td>Yes<\/td>\n<\/tr>\n<tr>\n<td>Can change in child Components?<\/td>\n<td>Yes<\/td>\n<td>No<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>Other React Terminology<\/h4>\n<p>The other React terminology like <a href=\"https:\/\/reactjs.org\/docs\/glossary.html#lifecycle-methods\" target=\"_blank\" rel=\"noopener\">Life Cycle methods<\/a>, <a href=\"https:\/\/reactjs.org\/docs\/glossary.html#controlled-vs-uncontrolled-components\" target=\"_blank\" rel=\"noopener\">Controlled vs controlled components<\/a>, <a href=\"https:\/\/reactjs.org\/docs\/glossary.html#keys\" target=\"_blank\" rel=\"noopener\">Keys<\/a>, <a href=\"https:\/\/reactjs.org\/docs\/glossary.html#refs\" target=\"_blank\" rel=\"noopener\">Refs<\/a>, <a href=\"https:\/\/reactjs.org\/docs\/glossary.html#events\" target=\"_blank\" rel=\"noopener\">Events<\/a> &amp; <a href=\"https:\/\/reactjs.org\/docs\/glossary.html#reconciliation\" target=\"_blank\" rel=\"noopener\">Reconciliation<\/a> will be discussed separately.<\/p>\n<h5>Starting to Thinking in React Way!<\/h5>\n<p>In an effort to start learning React by building react components, it&#8217;s time to start <a href=\"https:\/\/reactjs.org\/docs\/thinking-in-react.html\" target=\"_blank\" rel=\"noopener\">thinking in React way<\/a> by building simple applications and learn step by step to build more complex applications.<\/p>\n<h5>Wrapping Up<\/h5>\n<p>In this learning-note post, basic React terminology and an overview of these concepts were briefly discussed. The next step to start using these concepts to build a simple React applications.<\/p>\n<p>NEXT: Learning to Work With React Components<\/p>\n<h5>Useful Resources and Links<\/h5>\n<p>While preparing this post, I have referred the following references extensively. Please to refer original posts for more detailed information.<\/p>\n<ul>\n<li><a href=\"https:\/\/reactjs.org\/docs\/hello-world.html\" target=\"_blank\" rel=\"noopener\">Learn React Guide<\/a> | <a href=\"https:\/\/reactjs.org\/docs\/getting-started.html\" target=\"_blank\" rel=\"noopener\">React Documentation<\/a><\/li>\n<li><a href=\"https:\/\/lucybain.com\/blog\/2016\/react-state-vs-pros\/\" target=\"_blank\" rel=\"noopener\">ReactJS: Props vs. State<\/a> by <em>Lucy Bain<\/em> | <a href=\"https:\/\/lucybain.com\/\" target=\"_blank\" rel=\"noopener\">lucybain.com<\/a><\/li>\n<li><a href=\"https:\/\/blog.usejournal.com\/a-beginners-guide-to-react-36b19943d58f\" target=\"_blank\" rel=\"noopener\">A Beginner\u2019s Guide to\u00a0React<\/a> by <em>Betsy Sallee<\/em>| Noteworthy &#8211; The Journal Blog<\/li>\n<li><a href=\"https:\/\/github.com\/uberVU\/react-guide\/blob\/master\/props-vs-state.md\" target=\"_blank\" rel=\"noopener\">React Guide<\/a> | <a href=\"https:\/\/github.com\/uberVU\" target=\"_blank\" rel=\"noopener\">uberVU GitHub<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Note: This post is work-in-progress learning-note and still in active development and updated regularly. After React development environment setup, I wanted to dig into React world. React API is known as most popular JavaScript (JS) library to allow developers to build interactive user interfaces for webs. Build encapsulated components that manage their own state, then [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[5],"tags":[],"class_list":["post-2552","post","type-post","status-publish","format-standard","hentry","category-reactjs"],"_links":{"self":[{"href":"https:\/\/learncode.tinjurewp.com\/wp-json\/wp\/v2\/posts\/2552","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/learncode.tinjurewp.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/learncode.tinjurewp.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/learncode.tinjurewp.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/learncode.tinjurewp.com\/wp-json\/wp\/v2\/comments?post=2552"}],"version-history":[{"count":0,"href":"https:\/\/learncode.tinjurewp.com\/wp-json\/wp\/v2\/posts\/2552\/revisions"}],"wp:attachment":[{"href":"https:\/\/learncode.tinjurewp.com\/wp-json\/wp\/v2\/media?parent=2552"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/learncode.tinjurewp.com\/wp-json\/wp\/v2\/categories?post=2552"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/learncode.tinjurewp.com\/wp-json\/wp\/v2\/tags?post=2552"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}