7 Things to Consider Before Working on React

Engineering Sep 28, 2019

It’s very crucial to understand React before using it in your project, or else it’s going to make things tough for you.

Recently, I moved from Angular to React, and I didn’t know where to start. So, I decided to build React Boilerplate and during development, I learned some things which helped in faster and better development.‌
‌‌

‌7 Things to Consider Before Reacting

1.TypeScript

With Typescript (a superset of JavaScript), you can easily write pure object-oriented code with concepts like classes, modules, interfaces, generics, and static typing.

The code becomes more readable and clean, it saves developer time. We can easily use TypeScript to React.

2.Unit Testing

Unit testing simply verifies the working of individual units of code as expected. It is an essential component during errorless code shipping.

Although in the initial stage of development, it is not so required as the application still in the innovation phase but it really helps to build better apps.

3.Linting

Linting helps in identifying any programmatic and stylistic errors in React It reduces errors and improves the overall quality of the code.

You can also use a style guide which also helps in checking the code against basic issues such as syntax errors, incorrect naming, spacing, etc

3.Error Tracking

Finding and fixing errors is an essential part of application development. As your application starts to grow, it becomes harder and time-consuming to track the exact error.

To handle this we can use Sentry which reports errors in real-time, easy tracking, prioritize, identify, reproduce, and fix errors.

4.Dependency Injection

Dependency Injection means feeding the data into the application according to need. It’s also very useful for testing as it allows dependencies to be mocked. You can test the application with fake data easily.

You must have heard of it in Angular Application, but React does not have an inbuilt dependency injection. You can inject all dependencies in one place, and use all other components via props. The dependencies can be wrapped using high order components.

5. Localization

In a country like India, users understand various languages such as Hindi, Marathi, Punjabi. Localization helps apps whose user base is divided across distinct languages. for example, An app that allows the users to view content in languages such as Hindi, Marathi.

6. Configuration Management

The initial settings of your application should be properly managed as it becomes difficult when the application grows.

You can manage all your app configuration in the .env file and access via process.env.SOME_DATA but config module provides a more efficient way to manage all your app configurations. Earlier I wrote a blog that tells how to use the config module in the NodeJS app.

These were the findings that helped me to kickstart mine react app. You can use the boilerplate in your application.

What’s the biggest thing you’re struggling with right now that we as a technology consulting company can help you with? Feel free to reach out to us at info@jalantechnologies.com. We hope our assistance will help!

Tags

Gaurav Umrani

Product Engineer | JavaScript | Angular | Node | React | Go

Great! You've successfully subscribed.
Great! Next, complete checkout for full access.
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.