Introduction to React.js | State and Props

Introduction to React.js | State and Props

A react.js component contains two variable by default. The first variable is called "state" and constains properties of the component. Each time we update the "state", the whole component is re-rendered. "props" are variable which are passed to components as parameters. "props" are read only and hence are not modifiable by the child components.

To create a React.js application, you need to install node.js and npm(Node Package Manager) and then type
npx create-react-app my-app
on the command prompt

When node.js and npm are installed a node_modules folder will be created which will store all node packages with their dependencies resolved. Also a package.json and package-lock.json will be created and packages required with their dependencies are installed using these two files (package.json and package-lock.json)

Comments

Popular posts from this blog

Parallel Database design, query processing

Laravel | PHP | Basics | Part 2

Apache Hadoop | Running MapReduce Jobs