My articles about React

How to pass and read query parameters from one page of your application to another by using the React Router

In this post we are going to see how you can register a new route in your React application and then pass information with the help of query parameters from one subpage to another.

Let us suppose the following scenario. You have page that contains a list of products with some basic information. You want to be able to click on an item of this list and navigate to a details-page, where the user can find more details about a specific product.

The following code examples are written in TypeScript. Visual Studio provides a great starting template for your React projects. I used the 4th generation of the React Router

First we need two routes for the scenario we just mentioned. The first route loads all the products, with only a limited information for each of them, from our backend and the second one loads the all the details to one product:

Read the complete article

Hints and tips for better programming with the React Native framework

Based on my current experience with the React Native framework, I would like to share with you some hints and tips that will improve your skills in the way you develop with the framework.

Isolate the business logic of your application from the UI/ components code

This is probably the most valuable information someone should have in her mind when developing with React Native. React Native tries to be as platform independent as possible, however, there will be cases, that you will have to write different JavaScript code for iOS and different code for Android.

Read the complete article

A small guide on how to run your React Native app on iOS using the XCode Simulator

You decided to create a new application for iOS and you want to program the app with the React Native framework.

Here is a list with all the steps you have to take if you want to start XCode Simulator and test the UI of your application on your developer machine:

Read the complete article

How to fix the 'Unable to find "react" ("npm") in the registry' error when using the tool Typings and TypeScript

During the last years we see that every month new JavaScript frameworks/ tools/ libraries are comming out to the public and they all promise to help us develop better, faster and give more quality to our applications. One of the favorite combinations is currently the use of the React framework, TypeScript as superset of JavaScript and the webpack tool for combining files together, dependencies and more.

When using the combination, it is very probably that you are also going to use the Typings plugin for fast downloading of definitions files for TypeScript.

If you installed react with npm and you get the ‘Unable to find “react” (“npm”) in the registry’ error from Typings when you try to download the d.ts file of react, then here is the solution to your problem:

Read the complete article

Create a breadcrumb list of links with JavaScript and use it inside your React applications!

The advantages of using breadcrumbs in your web applications are widely known.

  • The users get a chain of links that helps them understand where they are in your website and how they came to this page, and how provides them an easy when to navigate back in the hierarchy of links.

  • Breadcrumbs are considered to be a best practice for the SEO of your application.

Suppose we have the following example of chained links in a breadcrumb:

Main page > Main category 1 > Sub category 1 > Product 1

Read the complete article