0% found this document useful (0 votes)
8 views2 pages

React Notes

The document discusses key concepts in React development, including the use of scripts in package.json and the difference between npm commands. It explains React elements, components (both class-based and functional), and the concept of component composition. Additionally, it highlights the readability of JSX and clarifies that a component is a JavaScript function returning JSX code.

Uploaded by

juhi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views2 pages

React Notes

The document discusses key concepts in React development, including the use of scripts in package.json and the difference between npm commands. It explains React elements, components (both class-based and functional), and the concept of component composition. Additionally, it highlights the readability of JSX and clarifies that a component is a JavaScript function returning JSX code.

Uploaded by

juhi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
You are on page 1/ 2

1. we can write scripts for shortcuts in package.

json
Npm run start and npm start same thing
npm bulid will not work we have to use npm run build becuse npm has reserved the keyword start

2. React Element
React.createElement create react object and when we render into the DOM then it will convert into
an html which we see on the browser

3. React Component
There are 2 ways of creating React component
Class Based component (Old way – uses Javascript classes)
Functional component (New way – use Javascript function)

4. ShortHand function const fun=()=> true


Normal function const fun=()=> { return true}
Both the above function are same

Both are same

5. Component composition
injecting component into other component
6. JSX is making our code more readable. JSX is not react
7. Component is noraml javascript function which is returing some JSX code

You might also like