Posts

Showing posts from September, 2020

React Component and Props

Image
 React Component and Props In last blog we have learned about Getting started with React. If you have not gone through it check it out- https://letslearnwithmahesh.blogspot.com/2020/09/getting-started-with-react-js.html https://letslearnwithmahesh.blogspot.com/2020/09/project-structure-of-react-js.html React Component are independent bit of code which are planned to reuse with different component. Component resembles to JavaScript function which return some Html in the response. React Component can be classified into two category class component and function component. In this tutorial we will be discussing both of them. Create Class Component  The Name of the Class Component must be start with Upper case latter. The class type of component needs to inherit from React.Component . Due to Extending React.Component class component has access to many build in function. The class component needs to have a method which return HTML with naming Render(). Lets add a class component wit...

Project Structure of React Js

Image
Project Structure of React JS In last blog we have learned about Getting started with React. If you have not gone through it check it out- https://letslearnwithmahesh.blogspot.com/2020/09/getting-started-with-react-js.html Lets learn the folder structure and what is the use of each file in project. In last session we created our "my-app" using create-react-app template provided by Facebook.  Project structure Upon opening the created app in VS Code we could see the below structure of the application.  There are multiple folder and files present in the project and each have there own importance. So lets see each one of them one by one- node_modules The root folder contains folder node-modules This folder holds all the dependency and sub dependency we have in our project. This folder is automatically generated by npm. We shold not update any of the files from this folder. There are multiple dependency react have and all these dependency are generated from npm install command ...