Open cookies4u opened 7 years ago
@cookies4u ohhhhh wow . Thank you!! This is so nice!!! Could you explain the steps for us? I can't read what's in the box :P ...
so passing a json array of objects to react is not as simple as handlebars. We have 3 options. The hardest option is using something like redux The simpler option due to our time constraint is like the diagram in the image above. We can use a fetch or $.ajax call within the onClick event The code on the bottom right is how it may potentially look (will have to tweak). Mike said you guys may be familiar with setState. Note: list is just the api route. In our case it would be api/courses
The fetch command basically refresh the react module
http://stackoverflow.com/questions/30765163/pretty-printing-json-with-react