Create-react-app: Showing an Array in string Format in UI

Created on 17 Jul 2020  路  5Comments  路  Source: facebook/create-react-app

bug report needs triage

Most helpful comment

This isn't a CRA issue, its a react issue and should probably be in Stack overflow

All 5 comments

Can you please explain clearly what exactly is the problem?

An Array of strings in js will render as string with "," in between all elements.
but in react it render without ''," and without space.

here is the code
1) innerText = "mission impossible".split(' ').join().split(', ');
Add a space in the first split and after the comma in the end split. The output is this
image
is this is what you are asking for?

This isn't a CRA issue, its a react issue and should probably be in Stack overflow

here is the code

  1. innerText = "mission impossible".split(' ').join().split(', ');
    Add a space in the first split and after the comma in the end split. The output is this
    image
    is this is what you are asking for?

it will work but it should work without adding space.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rdamian3 picture rdamian3  路  3Comments

AlexeyRyashencev picture AlexeyRyashencev  路  3Comments

DaveLindberg picture DaveLindberg  路  3Comments

jnachtigall picture jnachtigall  路  3Comments

fson picture fson  路  3Comments