Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

175
Views
Hardcoded strings/static contents in React/Redux app

I am optimizing a react/redux app and I wondered if there is the best practice to store and render hardcoded strings in such an app? Some of my components are using the same text and if there is a text change I will have to search all for all text occurrences. Would be better to have central location. I mean some static contents that y you do not want to put into state.

I would store all texts in a json object but I assume there must be a better way.

could anyone share his/her experience? any helpful tools or packages?

thank a lot for your answers!

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

thank you for comments. In case, someone looks for nice solution this is - https://github.com/yahoo/react-intl

Requires some setup though but does what I wanted through making first steps towards internalization of the app.

over 4 years ago · Santiago Trujillo Report

0

Nothing special here really regarding react or redux, you could just create a constants file...

export const VAR_NAME = "this is some text";
export const ANOTHER_VAR = "something else";

then when you want to use, simply:

import { ANOTHER_VAR } from 'path/to/constants/file';
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!