<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://wiki.chongtin.com/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="https://wiki.chongtin.com/feed.php">
        <title>Tutorial Site reject</title>
        <description></description>
        <link>https://wiki.chongtin.com/</link>
        <image rdf:resource="https://wiki.chongtin.com/ttps://wiki.chongtin.com/lib/tpl/bootstrap3/images/favicon.ico" />
       <dc:date>2026-04-09T00:57:12+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="https://wiki.chongtin.com/reject/component_lifecycles?do=revisions&amp;rev=1595299191"/>
                <rdf:li rdf:resource="https://wiki.chongtin.com/reject/components_functional_vs_class-based?do=revisions&amp;rev=1594280651"/>
                <rdf:li rdf:resource="https://wiki.chongtin.com/reject/connect_to_server_-_axios_js?do=revisions&amp;rev=1600053404"/>
                <rdf:li rdf:resource="https://wiki.chongtin.com/reject/create_a_project?do=revisions&amp;rev=1578280507"/>
                <rdf:li rdf:resource="https://wiki.chongtin.com/reject/deploy_on_weblogic?do=revisions&amp;rev=1612512278"/>
                <rdf:li rdf:resource="https://wiki.chongtin.com/reject/dynamic_classname?do=revisions&amp;rev=1594694132"/>
                <rdf:li rdf:resource="https://wiki.chongtin.com/reject/dynamic_inline_style?do=revisions&amp;rev=1594692828"/>
                <rdf:li rdf:resource="https://wiki.chongtin.com/reject/flexbox?do=revisions&amp;rev=1603763807"/>
                <rdf:li rdf:resource="https://wiki.chongtin.com/reject/grid?do=revisions&amp;rev=1603763847"/>
                <rdf:li rdf:resource="https://wiki.chongtin.com/reject/importing_css_file?do=revisions&amp;rev=1594631351"/>
                <rdf:li rdf:resource="https://wiki.chongtin.com/reject/inline_style?do=revisions&amp;rev=1594691554"/>
                <rdf:li rdf:resource="https://wiki.chongtin.com/reject/install?do=revisions&amp;rev=1603760207"/>
                <rdf:li rdf:resource="https://wiki.chongtin.com/reject/javascript_arrow_function?do=revisions&amp;rev=1599099752"/>
                <rdf:li rdf:resource="https://wiki.chongtin.com/reject/passing_value_reference_between_components?do=revisions&amp;rev=1594368954"/>
                <rdf:li rdf:resource="https://wiki.chongtin.com/reject/prop-types_for_type_checking?do=revisions&amp;rev=1579666719"/>
                <rdf:li rdf:resource="https://wiki.chongtin.com/reject/props?do=revisions&amp;rev=1578293974"/>
                <rdf:li rdf:resource="https://wiki.chongtin.com/reject/redux?do=revisions&amp;rev=1632907052"/>
                <rdf:li rdf:resource="https://wiki.chongtin.com/reject/router?do=revisions&amp;rev=1600748917"/>
                <rdf:li rdf:resource="https://wiki.chongtin.com/reject/state?do=revisions&amp;rev=1594364657"/>
                <rdf:li rdf:resource="https://wiki.chongtin.com/reject/using_list?do=revisions&amp;rev=1594628824"/>
                <rdf:li rdf:resource="https://wiki.chongtin.com/reject/using_props_state_and_binding?do=revisions&amp;rev=1578359467"/>
                <rdf:li rdf:resource="https://wiki.chongtin.com/reject/what_is_jsx?do=revisions&amp;rev=1594351981"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="https://wiki.chongtin.com/ttps://wiki.chongtin.com/lib/tpl/bootstrap3/images/favicon.ico">
        <title>Tutorial Site</title>
        <link>https://wiki.chongtin.com/</link>
        <url>https://wiki.chongtin.com/ttps://wiki.chongtin.com/lib/tpl/bootstrap3/images/favicon.ico</url>
    </image>
    <item rdf:about="https://wiki.chongtin.com/reject/component_lifecycles?do=revisions&amp;rev=1595299191">
        <dc:format>text/html</dc:format>
        <dc:date>2020-07-21T10:39:51+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Component Lifecycles</title>
        <link>https://wiki.chongtin.com/reject/component_lifecycles?do=revisions&amp;rev=1595299191</link>
        <description>Component Lifecycles

The component life cycles graph done in this site, &lt;https://projects.wojtekmaj.pl/react-lifecycle-methods-diagram/&gt;, and it is perfect. Here is the image I capture from this site. You should go there to see the newest version. Here is current version 16.4.


Life Cycle Functions

	*  constructor(props)</description>
    </item>
    <item rdf:about="https://wiki.chongtin.com/reject/components_functional_vs_class-based?do=revisions&amp;rev=1594280651">
        <dc:format>text/html</dc:format>
        <dc:date>2020-07-09T15:44:11+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Components Functional VS Class-based</title>
        <link>https://wiki.chongtin.com/reject/components_functional_vs_class-based?do=revisions&amp;rev=1594280651</link>
        <description>Components Functional VS Class-based

When creating component, we usually create a sub directory for that component. The following components are doing the same thing.
Functional Components are sometime called dumb component. They are simple and do not maintain it own state, and usually controller by</description>
    </item>
    <item rdf:about="https://wiki.chongtin.com/reject/connect_to_server_-_axios_js?do=revisions&amp;rev=1600053404">
        <dc:format>text/html</dc:format>
        <dc:date>2020-09-14T11:16:44+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Connect to Server - AXIOS JS</title>
        <link>https://wiki.chongtin.com/reject/connect_to_server_-_axios_js?do=revisions&amp;rev=1600053404</link>
        <description>Connect to Server - AXIOS JS

AXIOS is a Promise based HTTP client. It is not a part of the React.js library, but it can be used with react.  

Install

Do the following if you react project directory.


npm install axios


if you want to download the library into your repository, add</description>
    </item>
    <item rdf:about="https://wiki.chongtin.com/reject/create_a_project?do=revisions&amp;rev=1578280507">
        <dc:format>text/html</dc:format>
        <dc:date>2020-01-06T11:15:07+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Create a Project</title>
        <link>https://wiki.chongtin.com/reject/create_a_project?do=revisions&amp;rev=1578280507</link>
        <description>Create a Project

After install npx, use the following code. my-app would be the name of your project. This process is going to take sometime (in term of minutes, mine was 10+ minutes for the first time). Once the project is created, we can start it by</description>
    </item>
    <item rdf:about="https://wiki.chongtin.com/reject/deploy_on_weblogic?do=revisions&amp;rev=1612512278">
        <dc:format>text/html</dc:format>
        <dc:date>2021-02-05T16:04:38+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Deploy on WebLogic</title>
        <link>https://wiki.chongtin.com/reject/deploy_on_weblogic?do=revisions&amp;rev=1612512278</link>
        <description>Deploy on WebLogic

You need to create 3 files, and they are web.xml, pom.xml, weblogic.xml(optional) in your existing react project. we put all file in the root directory of the react project.

weblogic.xml

Mainly to tell which version of WebLogic we are using, and the context-root of the project. If you are cool with the context-root as your war file name, you can skip this part.</description>
    </item>
    <item rdf:about="https://wiki.chongtin.com/reject/dynamic_classname?do=revisions&amp;rev=1594694132">
        <dc:format>text/html</dc:format>
        <dc:date>2020-07-14T10:35:32+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Dynamic className</title>
        <link>https://wiki.chongtin.com/reject/dynamic_classname?do=revisions&amp;rev=1594694132</link>
        <description>Dynamic className

Another way to do dynamic styling is through changing the class name directly. Here is how we change the className of a div (with className={myDivClasses}) dynamically based on prop.index. After all, className is just a string with names that spereated by a space.</description>
    </item>
    <item rdf:about="https://wiki.chongtin.com/reject/dynamic_inline_style?do=revisions&amp;rev=1594692828">
        <dc:format>text/html</dc:format>
        <dc:date>2020-07-14T10:13:48+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Dynamic Inline Styling</title>
        <link>https://wiki.chongtin.com/reject/dynamic_inline_style?do=revisions&amp;rev=1594692828</link>
        <description>Dynamic Inline Styling

It is possible that we dynamically change the CSS with inline styling. As we know that the styling is just an JavaScript object, we can change it before we render it. Here is a dumb example that change style.cursor = “pointer</description>
    </item>
    <item rdf:about="https://wiki.chongtin.com/reject/flexbox?do=revisions&amp;rev=1603763807">
        <dc:format>text/html</dc:format>
        <dc:date>2020-10-27T09:56:47+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Flexbox (CSS)</title>
        <link>https://wiki.chongtin.com/reject/flexbox?do=revisions&amp;rev=1603763807</link>
        <description>Flexbox (CSS)

Flexbox is a css layout module, basically used by a lot of page in these days. Material UI &lt;Grid&gt;&lt;Grid&gt; use it, so we kind of mention it here.

To learn it from the documentation, go here:
&lt;https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout/Basic_Concepts_of_Flexbox&gt;

To learn it from playing a game, go here:
&lt;https://flexboxfroggy.com/&gt;

justify-content</description>
    </item>
    <item rdf:about="https://wiki.chongtin.com/reject/grid?do=revisions&amp;rev=1603763847">
        <dc:format>text/html</dc:format>
        <dc:date>2020-10-27T09:57:27+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Grid</title>
        <link>https://wiki.chongtin.com/reject/grid?do=revisions&amp;rev=1603763847</link>
        <description>Grid

In material UI, grid uses for laying out component in order like the grid system in Bootstrap.  For details, go here: &lt;https://material-ui.com/components/grid/&gt;

Grid can be a container, or item , or both, and each grid has 12 equally divided columns on the screen. If the next grid did not fit on the 12-column row, it will start a new row like the example shown below.</description>
    </item>
    <item rdf:about="https://wiki.chongtin.com/reject/importing_css_file?do=revisions&amp;rev=1594631351">
        <dc:format>text/html</dc:format>
        <dc:date>2020-07-13T17:09:11+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Importing CSS file</title>
        <link>https://wiki.chongtin.com/reject/importing_css_file?do=revisions&amp;rev=1594631351</link>
        <description>Importing CSS file

React using sudo DOM, and we can apply css style to each component independently. Usually, we put the css file and the component in the same sub directory. 


Assume we want to do something like above. here is our ItemComponent.css</description>
    </item>
    <item rdf:about="https://wiki.chongtin.com/reject/inline_style?do=revisions&amp;rev=1594691554">
        <dc:format>text/html</dc:format>
        <dc:date>2020-07-14T09:52:34+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Inline style</title>
        <link>https://wiki.chongtin.com/reject/inline_style?do=revisions&amp;rev=1594691554</link>
        <description>Inline style

The basic idea is to setup a JavaScript object either with let or const, and then apply it inside the tag with style={...}. It is import to note that we are using sudo DOM, and the style property names are changed from kebab-case (using hyphen-separated) to</description>
    </item>
    <item rdf:about="https://wiki.chongtin.com/reject/install?do=revisions&amp;rev=1603760207">
        <dc:format>text/html</dc:format>
        <dc:date>2020-10-27T08:56:47+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Install</title>
        <link>https://wiki.chongtin.com/reject/install?do=revisions&amp;rev=1603760207</link>
        <description>Install

It is easy. Once npm is installed, do the following in your project:

npm install @material-ui/core

To use the Material UI component in your project/component, simple import them like:

import {Paper, Grid, Typography} from &quot;@material-ui/core&quot;;</description>
    </item>
    <item rdf:about="https://wiki.chongtin.com/reject/javascript_arrow_function?do=revisions&amp;rev=1599099752">
        <dc:format>text/html</dc:format>
        <dc:date>2020-09-03T10:22:32+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>JavaScript Arrow Function</title>
        <link>https://wiki.chongtin.com/reject/javascript_arrow_function?do=revisions&amp;rev=1599099752</link>
        <description>JavaScript Arrow Function

Arrow function is used a lot in React.js. Here we copy the syntax from mozilla MDN &lt;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions&gt; for quick reference only. If you are looking for actual example, go there to take a look.


(param1, param2, …, paramN) =&gt; { statements } 
(param1, param2, …, paramN) =&gt; expression
// equivalent to: =&gt; { return expression; }

// Parentheses are optional when there's only one parameter name:
(sin…</description>
    </item>
    <item rdf:about="https://wiki.chongtin.com/reject/passing_value_reference_between_components?do=revisions&amp;rev=1594368954">
        <dc:format>text/html</dc:format>
        <dc:date>2020-07-10T16:15:54+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Passing Value, Reference Between Components</title>
        <link>https://wiki.chongtin.com/reject/passing_value_reference_between_components?do=revisions&amp;rev=1594368954</link>
        <description>Passing Value, Reference Between Components

In this example, we will show how to pass value, reference between components. We will have an outter container component MyContainer, and within that component we will have 3 inner components InnerComponent</description>
    </item>
    <item rdf:about="https://wiki.chongtin.com/reject/prop-types_for_type_checking?do=revisions&amp;rev=1579666719">
        <dc:format>text/html</dc:format>
        <dc:date>2020-01-22T12:18:39+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>prop-types, For Type Checking</title>
        <link>https://wiki.chongtin.com/reject/prop-types_for_type_checking?do=revisions&amp;rev=1579666719</link>
        <description>prop-types, For Type Checking

prop-types helps us to type check the incoming props for a class in React. If the incoming type does not match with the setting, the code will still run, but a warning message will show up in the JavaScript console like:</description>
    </item>
    <item rdf:about="https://wiki.chongtin.com/reject/props?do=revisions&amp;rev=1578293974">
        <dc:format>text/html</dc:format>
        <dc:date>2020-01-06T14:59:34+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>props</title>
        <link>https://wiki.chongtin.com/reject/props?do=revisions&amp;rev=1578293974</link>
        <description>props

props can actually be any name you like, but by convention, people usually use the word props. props is a way that the parent component pass values to a child component. let's assume we have a child component like this:


import React from 'react';

const person = (props) =&gt; {
    return (
        &lt;div&gt;
            &lt;p&gt;I am a {props.name}, and I am {props.age} years old&lt;/p&gt;
            &lt;p&gt;{props.children}&lt;/p&gt;
        &lt;/div&gt;)
}
export default person</description>
    </item>
    <item rdf:about="https://wiki.chongtin.com/reject/redux?do=revisions&amp;rev=1632907052">
        <dc:format>text/html</dc:format>
        <dc:date>2021-09-29T17:17:32+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Redux</title>
        <link>https://wiki.chongtin.com/reject/redux?do=revisions&amp;rev=1632907052</link>
        <description>Redux

	*  Install redux, react-redux, and update the react-dom
	*  Create a reducer for storing the state, and handle the dispatched task
	*  Create the store in index.js, and provide it to the app by &lt;Provider...&gt;&lt;/Provider&gt;
	*  Using redux in your component:</description>
    </item>
    <item rdf:about="https://wiki.chongtin.com/reject/router?do=revisions&amp;rev=1600748917">
        <dc:format>text/html</dc:format>
        <dc:date>2020-09-22T12:28:37+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Route</title>
        <link>https://wiki.chongtin.com/reject/router?do=revisions&amp;rev=1600748917</link>
        <description>Route

This is what make a single page app do not refresh.

Quick Start

It is a big topic, and here I want to make it as quick as possible to read.

	*  Install react-router, react-router-dom to your project by 

npm install --save react-router react-router-dom</description>
    </item>
    <item rdf:about="https://wiki.chongtin.com/reject/state?do=revisions&amp;rev=1594364657">
        <dc:format>text/html</dc:format>
        <dc:date>2020-07-10T15:04:17+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>state</title>
        <link>https://wiki.chongtin.com/reject/state?do=revisions&amp;rev=1594364657</link>
        <description>state

state can be used in both component base and functional base class with different methods.

Component-based Object

state is a special variable that represent the state of a Component. Any class that extends Component from 'react' can have this. Usually the state variable contains a map of variables. React will monitor it, and if it is changed, the view using the variables in state will also be updated.</description>
    </item>
    <item rdf:about="https://wiki.chongtin.com/reject/using_list?do=revisions&amp;rev=1594628824">
        <dc:format>text/html</dc:format>
        <dc:date>2020-07-13T16:27:04+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Using List</title>
        <link>https://wiki.chongtin.com/reject/using_list?do=revisions&amp;rev=1594628824</link>
        <description>Using List

We are going to create something like this:

By clicking the add button, it will add an item into the list, and by clicking the item itself, it will be removed.

We will have a contain class component MyContainer that keep the list and state, and item functional component</description>
    </item>
    <item rdf:about="https://wiki.chongtin.com/reject/using_props_state_and_binding?do=revisions&amp;rev=1578359467">
        <dc:format>text/html</dc:format>
        <dc:date>2020-01-07T09:11:07+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Using props, state, and Binding</title>
        <link>https://wiki.chongtin.com/reject/using_props_state_and_binding?do=revisions&amp;rev=1578359467</link>
        <description>Using props, state, and Binding

Ouptut



App.js

One thing to notice is we have use event.target.value inside one of the call back function the UserInput component.


import React, { Component } from 'react';
import './App.css';
import UserInput from './UserInput/UserInput'
import UserOutput from './UserOutput/UserOutput'
import &quot;./UserOutput/UserOutput.css&quot;

class App extends Component {
  state = {
    usernames: [
      { name: &quot;name1&quot; },
      { name: &quot;name2&quot; }
    ]
  }

  onButtonClicked…</description>
    </item>
    <item rdf:about="https://wiki.chongtin.com/reject/what_is_jsx?do=revisions&amp;rev=1594351981">
        <dc:format>text/html</dc:format>
        <dc:date>2020-07-10T11:33:01+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>What is JSX</title>
        <link>https://wiki.chongtin.com/reject/what_is_jsx?do=revisions&amp;rev=1594351981</link>
        <description>What is JSX

Do not let the name fool you. It is basically JSX is a HTML-like language for React component to return it UI. It is a syntactic sugar for React.createElement(). The following React functional component return a JSX within the ().

One thing to note that for</description>
    </item>
</rdf:RDF>
