Skip to content

I made some code samples of React.js. These examples are purposely written in a simple style.

Notifications You must be signed in to change notification settings

rahmanHeidarykiany/SampleCodeReac.JS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 

Repository files navigation

SampleCodeReac.JS

I made some code samples of React.js. These examples are purposely written in a simple style.

These examples are purposely written in a simple style.

How to use

First download repository, there should be 3 files, "Rahman_build", "Rahman_Examples", "README.md" Examples are in "Rahman_Examples" files.

Rahman_EX_2: Use JavaScript in JSX

curly brackets ({) as the beginning of JavaScript syntax and takes angle brackets (<) as the beginning of HTML syntax

Rahman_EX_3:Use array in JSX

JSX can implicitly concat all members of the array.

Rahman_EX_4: Define a component

Creates a component class, and implements a render method to return an component instance of the class.

Rahman_EX_5: this.props.children

React utilize this.props.children to access a component's children nodes.

Rahman_EX_6: PropTypes

props in React can be any type and this is specific attributes of Components React has a solution for this and it's called PropTypes.

Rahman_EX_7: Finding a DOM node

Reference a DOM node in a component with React'sref attribute

Rahman_EX_8: this.state

Component are such as state machines in React, this.setState() to update this.state and re-render the component ,and this.state to hold component's state,

Rahman_EX_9: Form

value attribute of Form components are unaffected by any user input. Access or update the value in response to user input.

Rahman_EX_10: Component Lifecycle

Components have three main parts Mounting, Updating and Unmounting. React provides hooks into these lifecycle part.

Rahman_EX_11: Ajax

Ajax to fetch data of a component from a server or an API provider

Rahman_EX_12: Display value from a Promise

RepoList component gets a Promise object as its property.

About

I made some code samples of React.js. These examples are purposely written in a simple style.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published