DEV Community

Cover image for Recursive rendering in React: Building a universal JSON renderer

Recursive rendering in React: Building a universal JSON renderer

Sebastijan Grabar on October 14, 2018

In the last year, I have been working with React extensively, both for work and for my own satisfaction. I stumbled upon some pretty interesting pa...
Collapse
 
ikeeptrying profile image
Dre

Thank you! Finally! I've been looking FOR. EVER. For something like this.
Why does everybody assume that data comes in nice, proper, symmetrical format, in arrays, etc.? Literally EVERY article and tutorial - even super advanced ones - is based on that assumption, it was making me crazy!
Thanks again, I saved this, I'll be referring back to it.

Collapse
 
baso53 profile image
Sebastijan Grabar

No problem mate, glad to help!

Collapse
 
avanthikaa profile image
Avanthikaa

Is there a way to also accept values for modifying the JSON data?
For instance, if I wanted to change the name from "Becky Vega" to something else, is there a way that this code can be modified to make it an editable field instead of just a display?

Collapse
 
zeerorg profile image
Rishabh Gupta

We have peaked react.

Collapse
 
singhalvikash84 profile image
singhalvikash84

Where can I find the source code for this ?

Collapse
 
baso53 profile image
Sebastijan Grabar • Edited

Hey, I just put it on GitHub!

react-json-component

Collapse
 
prvnbist profile image
Praveen Bisht

This is what I've been looking for, thank you so muchπŸ™Œ