<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Aishwarya Karanth</title>
    <description>The latest articles on DEV Community by Aishwarya Karanth (@aishwaryakaranth).</description>
    <link>https://dev.to/aishwaryakaranth</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F461921%2Fa80446e1-17ce-4488-95d2-04a65378340c.png</url>
      <title>DEV Community: Aishwarya Karanth</title>
      <link>https://dev.to/aishwaryakaranth</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aishwaryakaranth"/>
    <language>en</language>
    <item>
      <title>Book Recommendation app using React</title>
      <dc:creator>Aishwarya Karanth</dc:creator>
      <pubDate>Fri, 25 Dec 2020 03:00:42 +0000</pubDate>
      <link>https://dev.to/aishwaryakaranth/book-recommendation-app-using-react-4c9m</link>
      <guid>https://dev.to/aishwaryakaranth/book-recommendation-app-using-react-4c9m</guid>
      <description>&lt;p&gt;If you love reading books, you can build a React app to recommend all the books you like across various genre using React.js. This is a beginner level React project.&lt;br&gt;
In this book recommendation app, there are two genres- Fiction and Non Fiction. You can add as many genres as you want. When the user clicks a particular genre, a list of books will be recommended along with the rating, description of the book and the link to buy.&lt;br&gt;
Let's build!&lt;/p&gt;

&lt;p&gt;Let us create an object to store all our books and store lists of all the books that we'd want to recommend. The code snippet for the same can be seen below.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fb9myk4so5mg3wvz8pywo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fb9myk4so5mg3wvz8pywo.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let us now convert the object to an array. The syntax for the same is &lt;code&gt;Object.keys(ObjectName)&lt;/code&gt;.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F0crw2g9dkuinkswkk7gg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F0crw2g9dkuinkswkk7gg.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We will now use useState hook to display one genre by default. &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwl4fs9m2roq796rxlnbe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwl4fs9m2roq796rxlnbe.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We will now render both the genre on button click using map(). In this case, it will render fiction and non-fiction. On button click, we will call the function &lt;code&gt;bookInputHandler(bookCategory)&lt;/code&gt; where we are passing &lt;code&gt;bookCategory&lt;/code&gt; as the parameter.&lt;/p&gt;

&lt;p&gt;We will now define the &lt;code&gt;bookInputHandler&lt;/code&gt; function. In the &lt;code&gt;bookInputHandler&lt;/code&gt; function, we will set the bookCategory using useState hook.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fxzyv093kzvcg1c63n12x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fxzyv093kzvcg1c63n12x.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We now render all the details of the books in a particular genre that is the title, image, description, link to buy.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fzz1vi7xnm0mijozpeq3j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fzz1vi7xnm0mijozpeq3j.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And finally, we display the details on the browser using JSX.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F0kracotyajyn19yab426.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F0kracotyajyn19yab426.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We have now built our very own book recommendation app using React.&lt;/p&gt;

&lt;p&gt;You can view the finished app &lt;a href="https://8h1t6.csb.app/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;br&gt;
You can view the source code for the complete app &lt;a href="https://github.com/AishwaryaKaranth/neog-book-recommendation-react/tree/main/src" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Thank you for reading!&lt;/p&gt;

</description>
      <category>react</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
