Build a Portfolio Single Page Application Using React JS
Get link
Facebook
X
Pinterest
Email
Other Apps
If you are a newbie and struggling to get commenced with React JS, Read my preceding article on How I found out React JS as a noob — Ultimate React JS Starter Guide.
Please ensure you're carried out with the conditions of React JS which I’ve mentioned in my preceding article.
Ok, so in this big article, you’ll analyze React JS using Building a complete Portfolio Website as a Single Page Application (SPA).
This is a “Do It Along” kind of article. You’ll virtually have an amazing result if you construct along.
Here is the mission GitHub repository, you could clone or download the complete undertaking.
Things you’ll soak in:
Creating and implementing custom Components.
Working with external additives.
Working with Props.
Working with States.
Dynamic Rendering.
React Routing.
And Using CSS in React JS.
Let’s understand some concepts…
What is a “ Component “ in React JS?
React follows Component architecture, which means that every part of an internet app or website is part, all are made one by one and finally equipped into a parent component that's then rendered.
As within the photograph sidebar, header, chart all are separate additives fixed into one single parent issue.
A Component is a Javascript File, for example, you want to create a sidebar component then you need to create a “Sidebar.Js” file.
A factor may be of two types:-
Sub-Component
A sub-factor is a part that is living inside of another component.
Parent Component
A Parent aspect is a component in which sub-additives is living in.
How does a “Component” appear like in code?
The below code snippet is the boilerplate code for any issue. To create an element just replica this code and replace “YourComponentName” to something call you to need for the component.
“ YourComponentName.Js ”
Now let’s get started with Building the portfolio website the usage of React JS
If “Node JS” isn't always installed, Download Node JS and set up it.
I use Visual Studio Code for most of my React JS project and I highly advocate you to use.
import React, { Component } from 'react'class YourComponentName extends Component {render() {return (<div>{/* Your Html/JSX code goes here */}<h1>This is my component</h1></div>)}}export default YourComponentName
All the components have a parent component, it might be either “App.js” or some other component.
import React, { Component } from 'react';
That’s a common line of code you’ll see in almost all the components everywhere. In that, we are importing React and Component class from the ‘react’ module. Which enables us to create custom components.
class YourComponentName extends Component {
This is a class component, replace “YourComponentName” to whatever name you want.
render() {return (<div><h1>This is my component</h1></div>)
The render() method along with the return() method renders the content into the DOM.
and for now “YourComponentName.js” component will return “This is my component”.
Note: A component must return only one Node meaning a single <div> and everything inside it </div> , or a single tag (element).
export default YourComponentName
the above line of code is very important, make sure you add it compulsory, “export” keyword defines what are all the methods(functions) should be accessible to the component importing this component.
Now let’s get started with Building the portfolio website using React JS
If “Node JS” is not installed, Download Node JS and install it.
I use Visual Studio Code for most of my React JS project and I highly recommend you to use.
Now, create a new folder, name it whatever you want.
Open vs code.
Press ctrl-shift-n (cmd-shift-n) to open a new vscode window.
within the new window, click on the “Open Folder” blue button on the Explorer pane,
Browse and pick out the folder you created.
Go to View → Terminal to open a terminal internal vscode.
After that, create a React JS undertaking the usage of “create-react-app” CLI, now name the project whatever you need for now I’ll call it as “Portfolio_Website_ReactJS”.
$ npx create-react-app Portfolio_Website_ReactJS
after you get the message “Happy Hacking”, move inside the project directory
$ cd Portolio_Website_ReactJS
Folder structure for this project!
Initial folder structure
Inside the “src” folder, create three new folders and name them “components”, “contents”, and “img” respectively.
Inside the “Components” folder
Create the below components as javascript files in the “ components ” folder.
Navbar.jsThis component is the sidebar and will hold a set of “NavItems” components(Home, About, Education, Skills, Contact). It’s just a pink and blue gradient box.
NavItem.jsThis component will be the navigation items (e.g. Home, About, Education,…).
Social.js This component holds the Social media icon with links.
Social component preview
Widecard.jsThis component will hold the Education Details (as shown in the final result GIF above).
The world of the internet is predominantly owned by means of programmers. The one programming language this is rapidly converting and bringing change at an accelerating velocity is JavaScript. The React and Angular are the large systems that every novice and veteran programmer is engaged with. A new debate is being raised inside the programming international that which language is comparatively smooth to use. As both React and Angular are highly advanced and are used globally. Follow also my site Angular Training This blog evaluates both the languages to discover which one is less complicated for programmers to understand. React Vs. Angular Both Angular and React are unmarried page applications. Angular is a full-featured MVC framework, developed and maintained by using Google while React is an open-source JS library that is developed and maintained via Facebook. The device chain in React is high in comparison to Angular where it's miles low. ...
The Big Data product circle of relatives is renamed to Data Engineering. The following product names have changed: • Big Data Management --> Data Engineering Integration • Big Data Quality --> Data Engineering Quality • Big Data Streaming --> Data Engineering Streaming • Big Data Masking --> Data Engineering Masking Also, Enterprise Data Catalog and Enterprise Data Preparation are now aligned inside the Data Catalog product's own family. In our persisted efforts to offer a better search experience, we have delivered improvements to our Knowledge Base search results interface: Tabbed Navigation for seek effects MultiMedia Demo Widget. Tabbed Navigation for seeking results The seek outcomes page of the Knowledge Base has been redesigned to encompass tab navigation. The new tab view will display Knowledge Base articles, Product Documentation, How-To-Library, and Velocity Methodology in separate tabs. This new feature showcases the pri...
Over the years, the web development state of affairs has changed. As the wide variety of cellular customers is growing, builders are switching from internet improvement to cellular software. Today, there is a cellular utility for nearly everything. No matter in case you are an iOS, Android or Windows user, you can download a myriad of cell programs on your smartphone for various purposes. If you are a WordPress owner and making plans to build a cellular utility to serve your mobile users, you're at the proper place. In this post, we will discover ways to create an iOS/Android mobile app for WordPress. But before that, we would like to throw some light on the importance of having a local cell application. As said before, cell users are growing daily with the aid of day, it is essential to have a cellular application on your commercial enterprise. In the contemporary scenario, whilst anyone is having smartphones, capsules or iPhones, it may be quite hazardous t...
Comments
Post a Comment