We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
If you do not modify the component setup, where the Input and PostDisplay remain a separate file, I would move the state into a reducer. But note there is one problem where the test will need only one PostDisplay container div, so that I had to move up, or else you can find a way to map through in the PostDisplay the number of posts instead of in Home
I'm sure there are many other ways to do this, but I tried to stick with the JSX setup as it was currently.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Blog Post
You are viewing a single comment's thread. Return to all comments →
If you do not modify the component setup, where the
InputandPostDisplayremain a separate file, I would move the state into a reducer. But note there is one problem where the test will need only one PostDisplay container div, so that I had to move up, or else you can find a way to map through in the PostDisplay the number of posts instead of in HomeI'm sure there are many other ways to do this, but I tried to stick with the JSX setup as it was currently.