iansinnott / iansinnott/react-string-replace

Multiple matches on same string

Aberta
#35 2 comentários 6 reações 0 responsáveis Ver no GitHub
Linguagem predominante
JavaScript
Estrelas
666
Forks
54
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

Hi there, when using this twice on the same string what is happens is as follows, the first string matches and an array containing the react component returned from the callback fucktion is returned, and than in the second replace, it skips the symbol that was returned from the first run because it is not a string...
I think the solution would be to use flattenDeep instead of flatten, and clarify that callback functions should return an array instead of a component.

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Direção de pesquisa

Reproduza duas substituições na mesma string e inspecione a lógica de substituição relacionada ao uso de flatten; compare o comportamento com flattenDeep. Considera-se concluído quando correspondências repetidas preservarem os componentes React retornados e o requisito de que o callback retorne um array estiver esclarecido na documentação relevante.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
javascript, react
Domínio
frontend
Tipo de issue
Bug
Dificuldade
3/5
Tempo estimado
1-2 dias
Status de atividade
Estagnada
Clareza
Razoavelmente clara
Facilidade para iniciantes
42/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.