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

201
Vistas
how to JSON to Parse in react?

I have tree list components when I click on any item of the tree list it shows the result of JSON data. I don't wanna JSON format but parse format.

i have tried let json = JSON.parse(this.props.node, null, 4); but it showing Unexpected token u in JSON at position 0

You can visit the Link

class NodeViewer extends React.Component {
  constructor(props) {
    super(props);
  }
  render() {
    const style = styles.viewer;
    let json = JSON.stringify(this.props.node, null, 4);
    if (!json) {
      json = HELP_MSG;
    }
    return <div style={style.base}>{json}</div>;
  }
}

NodeViewer.propTypes = {
  node: PropTypes.object
};
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Remove the indentation

let json = JSON.stringify(this.props.node);
about 4 years ago · Juan Pablo Isaza 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