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.
First download repository, there should be 3 files, "Rahman_build", "Rahman_Examples", "README.md" Examples are in "Rahman_Examples" files.
curly brackets ({
) as the beginning of JavaScript syntax and takes angle brackets (<) as the beginning of HTML syntax
JSX can implicitly concat all members of the array.
Creates a component class, and implements a render method to return an component instance of the class.
React utilize this.props.children
to access a component's children nodes.
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.
Reference a DOM node in a component with React'sref
attribute
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,
value
attribute of Form components are unaffected by any user input.
Access or update the value in response to user input.
Components have three main parts Mounting, Updating and Unmounting. React provides hooks into these lifecycle part.
Ajax to fetch data of a component from a server or an API provider
RepoList
component gets a Promise object as its property.