ReactJS Tutorial – 4 – Components
- December 22, 2023
- Posted by: MainInstructor
- Category: Go JavaScript React VSCode
![*](https://i0.wp.com/allprowebdesigns.com/wp-content/uploads/2023/12/1703227254_maxresdefault.jpg?resize=840%2C430&ssl=1)
Video Title: ReactJS Tutorial – 4 – Components
In the very first introductory video we had a brief overview of the act component-based architecture in this video let’s get into the details of it in react a component represents a part of the user interface going back to the example from the earlier video you can say that our application has five
Components one for header one for side nav one for the main content one for the footer and finally one component to contain every other component the containing component is the root component and is usually named as app component in your application each of the four nested components describe only
A part of the user interface however all the components come together to make up the entire application components are also reusable the same component can be used with different properties to display different information for example the site map component can be the left side nav as well as the right
Side nav and as already mentioned components can also contain other components for example app component contains the other components now how does a component translate the code in our application the component code is usually placed in a JavaScript file for example AB component is placed in a BAS you can also have component
Files with dot J as X extension but for this series we stick to the simple dot J’s extension we will however take a closer look at JSX in one of the upcoming videos alright so a component is basically the code inside a dot j/s file but what does that code
Look like that depends on the type of the component in react we have two component types a stateless functional component and a stateful class component functional components are literally JavaScript functions the return HTML which describes the UI for example a function called welcome which returns an h1 tag that says hello
Vishwas now I know the HTML doesn’t say that but for simplicity just assume we are returning regular HTML fast components on the other hand our regular es6 classes that extend the component class from the reactive library they must contain a render method which in turn returns HTML for example class
Welcome extends react dot component and the class contains a render method which in returns an h1 tag that says hello which was now what is the difference and when to use one over the other we will discuss in the next few videos but make a note of the two component types
Stateless functional components and stateful class components now that we have some understanding of react components let’s examine the app component in our hello world application if I go back to vs code the first thing to notice is the file extension dot J s so it is a JavaScript file if
You take a look at the code you can clearly see that this is a class component and not a functional component the class is named as app and extends the component class from the react library it contains a render method which in turn returns some HTML now this
Is a simple hello world application and hence we have just one component you can have tens hundreds or even thousands of components Facebook I believe has over 30,000 components more complex the application more the number of components alright then let me quickly summarize what we have learned about
Components components describe a part of the user interface they are reusable and can be nested inside other components there are two types of components stateless functional components and stateful class components components are the building blocks of any react application so it is crucial to get a good understanding of the two types of
Components let’s start with functional components in the next video
-
Sale!
Wireless WIFI Repeater Extender Amplifier Booster 300Mbps
$29.99$14.99 Add to cartWireless WIFI Repeater Extender Amplifier Booster 300Mbps
Categories: Electronics, Wi-Fi Router, Wireless Wi-Fi Extender Tags: 300Mbps, 802.11N, Amplifier, Booster, Extender, mobile wi-fi booster, Remote, WIFI, Wireless, Wireless WIFI, Wireless WIFI Repeater, Wireless WIFI Repeater Extender, Wireless WIFI Repeater Extender Amplifier, Wireless WIFI Repeater Extender Amplifier Booster, Wireless WIFI Repeater Extender Amplifier Booster 300Mbps$29.99$14.99 -
Sale!
Full RGB Light Design Gaming Headset Headphones with Mic
$24.99$14.99 Add to cartFull RGB Light Design Gaming Headset Headphones with Mic
Categories: Electronics, Gaming, Gaming Headsets Tags: Design, Full, Full RGB Light Design Gaming Headset, Full RGB Light Design Gaming Headset Headphones, Full RGB Light Design Gaming Headset Headphones with Mic, Gamer, Gaming, Gaming Headset Headphones, gaming headset wireless, Headphone, Headphones, Headset, Light, Mic, Package, RGB$24.99$14.99 -
Sale!
Wireless BlueTooth Multi-Device Keyboard Mouse Combo
$39.99$19.99 Add to cartWireless BlueTooth Multi-Device Keyboard Mouse Combo
Categories: Electronics, Gaming, Gaming Keyboards, Keyboard Mouse Combos Tags: Combo, Keyboard, keyboard mouse combos, Mouse, MultiDevice, Set, WireKeyboard Mouse Combo, Wireless, Wireless BlueTooth Keyboard Mouse Combo, Wireless BlueTooth Keyboard Mouse Combos, Wireless BlueTooth Multi-Device Keyboard Mouse Combo, Wireless BlueTooth Multi-Device Keyboard Mouse Combos$39.99$19.99 -
Sale!
High Back Leather Executive Adjustable Swivel Gaming Chair with Headrest and Lumbar
$199.99$139.99 Add to cartHigh Back Leather Executive Adjustable Swivel Gaming Chair with Headrest and Lumbar
Categories: Gaming, Gaming Chairs Tags: Adjustable, Chair, computer chairs, Desk, Executive, Gaming, Girl, Headrest, High, High Back Leather Executive Adjustable Swivel Gaming Chair, High Back Leather Executive Adjustable Swivel Gaming Chair with Headrest, High Back Leather Executive Adjustable Swivel Gaming Chair with Headrest and Lumbar, High Back Leather Executive Adjustable Swivel Gaming Chairs, Leather, Lumbar, Office, Racing, Swivel$199.99$139.99 -
Sale!
Professional LED Light Wired Gaming Headphones with Noise Cancelling Microphone
$29.99$19.99 Select optionsProfessional LED Light Wired Gaming Headphones with Noise Cancelling Microphone
SKU: N/A Categories: Electronics, Gaming, Gaming Headsets Tags: Cancelling, Gaming, Gaming Headphones with Noise Cancelling Microphone, gaming headset, Headphones, Headset, LED, Light, Mic, Microphone, Noise, Professional, Professional LED Light Wired Gaming Headphones, Professional LED Light Wired Gaming Headphones with Noise Cancelling Microphone, Wired, Wired Gaming Headphones, Wired Gaming Headphones with Noise Cancelling Microphone$29.99$19.99 -
Sale!
Gaming Desk with LED Lights USB Power Outlets and Charging Ports
$349.99$249.99 Select optionsGaming Desk with LED Lights USB Power Outlets and Charging Ports
SKU: N/A Categories: Computer Desk, Gaming, Gaming Desk Tags: and Charging Ports, Charging, Desk, Desks, Gaming, gaming desk with led lights, Gaming Desks with LED Lights, Home, LED, Lights, Monitor, Office, Outlets, Port, Power, Room, Stand, USB, USB Power Outlets, White, Workstation$349.99$249.99 -
Sale!
Wired Mixed Backlit Anti-Ghosting Gaming Keyboard
$99.99$79.99 Add to cartWired Mixed Backlit Anti-Ghosting Gaming Keyboard
Categories: Electronics, Gaming, Gaming Keyboards Tags: Antighosting, Backlit, Blue, brown, Gaming, Gaming Keyboard, gaming keyboards, gaming keyboards and mouse, Keyboard, Laptop, Switch, Wired, Wired Mixed Backlit Anti-Ghosting Gaming Keyboard, Wired Mixed Backlit Anti-Ghosting Gaming Keyboards, Wired Mixed Backlit Gaming Keyboard$99.99$79.99 -
Sale!
Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset
$119.99$59.99 Add to cartWireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset
Categories: Electronics, Gaming, Gaming Headsets Tags: 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset, ANC, Audio, Bluetooth, Cancellation, Ear, Earphone, gaming headset, Headphones, Headset, Hi-Res Over the Ear Headphones Headset, HiRes, Noise, Wireless, Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Headphones, Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset, Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headsets$119.99$59.99 -
Sale!
Wired Sports Gaming Headset Earbuds with Microphone
$19.99$9.99 Select optionsWired Sports Gaming Headset Earbuds with Microphone
SKU: N/A Categories: Gaming, Gaming Headsets Tags: Accessories, Earbud, Earphone, Earphones, Gaming, gaming headset with microphone, Headphones, Headset, IOS, Microphone, Sports, Wired, Wired Sports Gaming Headset Earbuds, Wired Sports Gaming Headset Earbuds with Microphone, Wired Sports Headset Earbuds$19.99$9.99 -
Sale!
150W Universal Multi USB Fast Charger 16 Port MAX Charging Station
$49.99$29.99 Add to cart150W Universal Multi USB Fast Charger 16 Port MAX Charging Station
Categories: Charging Stations, Electronics Tags: 150W, 150W Charging Station, 150W Universal Multi USB Charging Station, 150W Universal Multi USB Fast Charger 16 Port MAX Charging Station, 150W Universal Multi USB Fast Charger 16 Port MAX Charging Stations, 150W Universal Multi USB MAX Charging Station, 16 Port MAX Charging Station, 3.5A, Charger, Charging, Fast, laptop charging stations, Max, Multi, Port, Stand, Station, Universal, USB$49.99$29.99
Thus is beautiful, thank you
thank's
please don't fake accent, it sounds ugly
completed 4th video. thank you 🙂
Hi, in my own app.js it's different from the tutorial. mine doesn't have the "class App extends"
🏗 React components represent parts of the user interface and can be nested inside each other, with one component usually designated as the root component (often named "app").
🔁 Components are reusable; the same component can display different information with different properties.
📦 React has two component types: stateless functional components (JavaScript functions returning HTML) and stateful class components (ES6 classes extending React's Component class with a render method).
🧩 Components are the building blocks of React applications and can number in the tens, hundreds, or even thousands in more complex applications. Understanding both component types is crucial.
Nice video
in my version it was a functional component NOT class component
finally i can now understand react 🙂 , thanyou bro 🙂 , really these are some of the most clear explanation i got about react so far
Easy & understandable explanation
So clear and easy to understand, thank you
Stupid naming conventions ..what do u mean by prop..its a paramter
Please note that a lot has changed since this video came out. Functional components are no longer stateless, as they can now use the useState hook. Hardly anyone uses class components because there is no to deal with the extra boilerplate
Hi Vishwas sir , your tutorial is just superb. thank you . – Virendra from mumbai.
great tutorialk but a little outdated… now component in app.js is a function
Very precise and easy to understand, many thanks 👍
This is so far the most clear react tutorial i have seen
It great and clear, thank you for those useful videos.
That one right here. Don't just make a step-by-step guide if you want a quality tutorial. Those educational bits are significant and make the viewer want to learn more and not click at another video out of boredom.
stateless components – function(props)
stateful components – class – render method to return html tags – this.props
your tutorials are better than the docs, even 4 years after :O :O
Thanks for Making this Tutorial but most of them are outDated now ! App.js is now functional component not Class component, Appreciate if you update these tutorial videos
Thank you so much! I learnt a lot from this tutorial!
Very descriptive video.Thanks for creating the series.
I really love your teaching well done sir
But I have a functional component rather than a class component in my App.js
I bought a udemy course on React. Should have just watched this series
Great instructor. Nice and easy to understand
thanks sir for making such videos for free
Excellent explanation ever! Thanks for sharing this tutorial
Wow….watching your entire React for beginners tutorial in May 2022, I must admit, you are a great teacher. Thank you Vishwas.