Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

180
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda