FCC Speedrun — Project #3 Wikipedia Viewer
Project #3 Wikipedia Viewer
A still from Wikepedia Viewer
This is my #3 project for FCC Speedrun 2, for my previous project please visit to these posts:
During this project, I learnt about how MediaWiki API handles request and the responses. And also to retrieve public wiki pages by using origin=* in the GET url.
I am using the built in onChange() method provided by react to handle the user’s input. There was a time when React failed to loop thorough the Objects and displayed this error:
Error
Uncaught (in promise) Error: Objects are not valid as a React child (found: object with keys )
If you meant to render a collection of children, use an array instead or wrap the object using createFragment(object) from the React add-ons. Check the render method of `exports`.(…)
I searched for a solution to this problem, because without the articles my web app was nothing but a static site, which renders only the images and text.
Soon I figured out a solution to convert my response Object (articles) into an Array. Here’s the solution which I found . convert Object {} to array [] in javascript *How can I convert an object such as {"1":5,"2":7,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0} into…*stackoverflow.com
Then I converted my articles into an array with some tweaks for proper data structure.
Later I compiled all the data received and my JSX code. Used the create-react-app pre-configured build command to produce a Production ready web app. I have used Surge to deploy my web app.
If you want to see the this project in action, please visit **here**.
If you want to see the Code for this project, please visit **here**.
P.S. If you enjoyed this article, it would mean a lot if you click the 💚 and share with friends.
Newsletter
If you liked this post, sign up to get updates in your email when I write something new! No spam ever.
Subscribe to the Newsletter