Learn more about our current job openings and benefits of working at FSL.
Detailed reviews and feedback from past and current clients.
Get to know the Management Team behind FullStack Labs.
Our step-by-step process for designing and developing new applications.
Writings from our team on technology, design, and business.
Get answers to the questions most frequently asked by new clients.
Learn about our company culture and defining principles.
A high level overview of FullStack Labs, who we are, and what we do.
A JavaScript framework that allows rapid development of native Android and IOS apps.
A JavaScript framework maintained by Facebook that's ideal for building complex, modern user interfaces within single page web apps.
A server side programming language known for its ease of use and speed of development.
A lightweight and efficient backend javascript framework for web apps.
An interpreted high-level programming language great for general purpose programming.
A JavaScript framework maintained by Google that addresses many of the challenges encountered when building single-page apps.
A JavaScript framework that allows developers to build large, complex, scalable single-page web applications.
A progressive JavaScript framework known for its approachability, versatility, and performance.
A progressive JavaScript framework known for its approachability, versatility, and performance.
A progressive JavaScript framework known for its approachability, versatility, and performance.
A progressive JavaScript framework known for its approachability, versatility, and performance.
A progressive JavaScript framework known for its approachability, versatility, and performance.
A progressive JavaScript framework known for its approachability, versatility, and performance.
A progressive JavaScript framework known for its approachability, versatility, and performance.
View a sampling of our work implemented using a variety of our favorite technologies.
View examples of the process we use to build custom software solutions for our clients.
View projects implemented using this javascript framework ideal for building complex, modern user interfaces within single page web apps.
View projects implemented using this framework that allows rapid development of native Android and IOS apps.
View projects implemented using this backend javascript framework for web apps.
View projects implemented using this high-level programming language great for general purpose programming.
View projects implemented using this server side programming language known for its ease of use and speed of development.
We have vast experience crafting healthcare software development solutions, including UI/UX Design, Application Development, Legacy Healthcare Systems, and Team Augmentation. Our development services help the healthcare industry by enhancing accessibility, productivity, portability, and scalability.
We offer a range of custom software development solutions for education companies of all sizes. We're experts in Education Software Development and specialists in enhancing the learning experience across web, mobile, and conversational UI.
We're experts in developing Custom Software Solutions for the Logistics Industry. Our work offered a whole new and more efficient way for Logistics companies to manage their crucial operations.
We partner with various construction industry organizations to build custom software development solutions. Our Construction Software Development Services allow construction companies to manage projects, resources, and documentation.
We have vast experience crafting healthcare software development solutions, including UI/UX Design, Application Development, Legacy Healthcare Systems, and Team Augmentation. Our development services help the healthcare industry by enhancing accessibility, productivity, portability, and scalability.
We offer a range of custom software development solutions for education companies of all sizes. We're experts in Education Software Development and specialists in enhancing the learning experience across web, mobile, and conversational UI.
We're experts in developing Custom Software Solutions for the Logistics Industry. Our work offered a whole new and more efficient way for Logistics companies to manage their crucial operations.
We partner with various construction industry organizations to build custom software development solutions. Our Construction Software Development Services allow construction companies to manage projects, resources, and documentation.
Learn more about our current job openings and benefits of working at FSL.
Detailed reviews and feedback from past and current clients.
Get to know the Management Team behind FullStack Labs.
Our step-by-step process for designing and developing new applications.
Writings from our team on technology, design, and business.
Get answers to the questions most frequently asked by new clients.
Learn about our company culture and defining principles.
A high level overview of FullStack Labs, who we are, and what we do.
A JavaScript framework that allows rapid development of native Android and IOS apps.
A JavaScript framework maintained by Facebook that's ideal for building complex, modern user interfaces within single page web apps.
A server side programming language known for its ease of use and speed of development.
A lightweight and efficient backend javascript framework for web apps.
An interpreted high-level programming language great for general purpose programming.
A JavaScript framework maintained by Google that addresses many of the challenges encountered when building single-page apps.
A JavaScript framework that allows developers to build large, complex, scalable single-page web applications.
A progressive JavaScript framework known for its approachability, versatility, and performance.
A dynamic programming language used in all sorts of web and mobile applications.
A cross-platform programming language designed to run robust applications on any device.
A UI toolkit used to build natively compiled applications from a single codebase.
A functional programming language that’s ideal for scalability, maintainability, and reliability.
A Customer Relationship Management (CRM) platform that seamlessly integrates with your business operations.
A high-performance programming language that makes it easy to build simple, reliable, and efficient software.
View a sampling of our work implemented using a variety of our favorite technologies.
View examples of the process we use to build custom software solutions for our clients.
View projects implemented using this javascript framework ideal for building complex, modern user interfaces within single page web apps.
View projects implemented using this framework that allows rapid development of native Android and IOS apps.
View projects implemented using this backend javascript framework for web apps.
View projects implemented using this high-level programming language great for general purpose programming.
View projects implemented using this server side programming language known for its ease of use and speed of development.
Welcome back to the second part of my six-part guide for Angular developers looking to learn React. Over the course of the series, we will rebuild Angular’s starter app example in React, covering each section of the Angular Starter docs in a separate article.
In the previous article, we reviewed the essential elements of the React template, the prop system, and the communication that takes place between parent and children components. In this article, we will discuss routing. Happy coding! :D
In general, React and Angular handle routing a bit differently.
Angular provides a routing service, but React requires developers to incorporate their own. There are a variety of React routing libraries listed in the React Documentation (you can find the list here). We will use the most popular library for this tutorial, React Router DOM.
React uses a Router component similar to Angular’s <router-outlet></router-outlet>, however it doesn’t use a configuration object. Instead, it specifies routes as child components.
In React, the <link> component replaces the <a></a> element when connecting separate URLs within a single-page application (SPA). When linking to an external resource, you will still generally use <a></a>.
Please fork this repo to continue working on our React project. You can find the Angular tutorial we are referencing here.
Let’s start by creating the Product Details Component. First, create a ProductDetails.js with the following code:
-- CODE language-jsx keep-markup --
import React from 'react';
const ProductDetails = () => {
return (
<div classname="product-deatils"></div>
<h2>Product Details works!</h2>
)
};
exportdefault ProductDetails;
Let’s integrate React Router Dom. Go to the index.js and import the BrowserRouter Component.
-- CODE language-jsx keep-markup --
import { BrowserRouter as Router, Route } from "react-router-dom";
Replace Fragment with BrowserRouter.
-- CODE language-jsx keep-markup --
<browserrouter></browserrouter>
/* Other components */
Then, replace ProductList with Route.
-- CODE language-jsx keep-markup --
<browserrouter></browserrouter>
<topbar></topbar>
<div classname="container"></div>
<route exact="" path="/" component="{ProductList}"></route>
Next, go to ProductList.js and import the Link component. It will render a valid <a></a> element and prevent the default behavior. It will also map the given props options on to the final anchor returned.
-- CODE language-jsx keep-markup --
import { Link } from "react-router-dom";
Add the match prop in line 9.
-- CODE language-jsx keep-markup --
const ProductList = ({ name, match }) => {
Finally, replace <a></a> with the following:
-- CODE language-jsx keep-markup --
<link to="{`${match.url}products/${index}`}" title="{`${product.name}" details`}="">
{ product.name }
At this point, the application will be able to:
In this section, we will pull the product details from the URL and pass it to the ProductDetails component. This will allow the ProductDetails component to display a product when it is selected from the ProductList page.
Go to the index.js and import the ProductDetails component.
-- CODE language-jsx keep-markup --
import ProductDetails from './ProductDetails';
Add a route for the product detail page:
-- CODE language-jsx keep-markup --
<route path="/products/:productId" component="{ProductDetails}"></route>
To read the param provided in the URL, replace the contents of ProductDetails.js with:
-- CODE language-jsx keep-markup --
import React from 'react';
import {products} from './products';
const ProductDetails = ({ name, match }) => {
const { params: { productId }} = match;
const product = products[productId];
return (
<div classname="product-deatils"></div>
<h2>Product Details</h2>
<div></div>
<h3>{ product.name }</h3>
<h4>{ product.price }</h4>
<p>{ product.description }</p>
)
};
exportdefault ProductDetails;
At this point the app should be able to display the product details on a product page. However, the product price will be missing a currency indicator. Angular uses a currency pipe to format a number into a monetary value. Pipes are essentially functions, so we can simply create a function to replicate Angular’s Currency Pipe.
To create the currency function, we need to use the built-in Number method toLocaleString. Start by adding the currency function to the ProductDetails.js file.
-- CODE language-jsx keep-markup --
const currency = number => {
return number.toLocaleString(
"en",
{
style: "currency",
currency: "USD",
minimumFractionDigits: 2
}
);
}
Then, use the function to format the price.
-- CODE language-jsx keep-markup --
<h4>{ currency(product.price) }</h4>
Learning how to code with React has made me a better Javascript developer. When you start working with React, you have to use many of Javascript’s core functionalities. You will also discover more elegant and efficient ways to write code.
In the next post, we will cover data management. I hope you found this tutorial useful for understanding routing in React!
---
At FullStack Labs, we pride ourselves on our ability to push the capabilities of cutting-edge frameworks like React. Interested in learning more about speeding up development time on your next project? Contact us.
We’d love to learn more about your project.
Engagements start at $75,000.