Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

177
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda