{"id":32861,"date":"2024-11-01T09:12:03","date_gmt":"2024-11-01T09:12:03","guid":{"rendered":"http:\/\/atmokpo.com\/w\/?p=32861"},"modified":"2024-11-01T11:21:42","modified_gmt":"2024-11-01T11:21:42","slug":"react-course-using-libraries","status":"publish","type":"post","link":"https:\/\/atmokpo.com\/w\/32861\/","title":{"rendered":"React Course: Using Libraries"},"content":{"rendered":"<p><body><\/p>\n<p>Hello! In this article, we will explore how to use and utilize various libraries in React. React is a powerful JavaScript library for building UIs, which can be used alongside various third-party libraries to create more efficient and convenient workflows. In this tutorial, we will introduce some popular libraries that can be used with React and learn how to enhance productivity through them.<\/p>\n<h2>1. What is React?<\/h2>\n<p>React is a user interface (UI) library developed by Facebook, known for its component-based architecture and the use of a virtual DOM to efficiently update the UI. Using React, you can easily build complex single-page applications (SPAs).<\/p>\n<h2>2. Advantages of React Libraries<\/h2>\n<ul>\n<li>Reusable components: React allows you to easily create and reuse various components that make up the UI.<\/li>\n<li>Virtual DOM: React uses a virtual DOM to minimize unnecessary updates to the actual DOM, improving performance.<\/li>\n<li>Diversity of ecosystem: React has a vast ecosystem that allows you to extend functionality through numerous libraries and plugins.<\/li>\n<\/ul>\n<h2>3. Using Libraries<\/h2>\n<h3>3.1. State Management Library: Redux<\/h3>\n<p>Redux is a library developed to simplify state management in React applications. It manages the entire state of the application in a centralized store, making it useful when multiple components need to share state.<\/p>\n<pre><code>npm install redux react-redux<\/code><\/pre>\n<h4>Example Usage<\/h4>\n<p>Below is how to create a simple counter application using Redux.<\/p>\n<pre><code>\nimport React from 'react';\nimport { createStore } from 'redux';\nimport { Provider, connect } from 'react-redux';\n\n\/\/ Action type\nconst INCREMENT = 'INCREMENT';\n\n\/\/ Action creator\nconst increment = () => ({\n    type: INCREMENT,\n});\n\n\/\/ Reducer\nconst counter = (state = 0, action) => {\n    switch (action.type) {\n        case INCREMENT:\n            return state + 1;\n        default:\n            return state;\n    }\n};\n\n\/\/ Create store\nconst store = createStore(counter);\n\n\/\/ Component\nconst Counter = ({ count, increment }) => (\n    <div>\n        <h1>{count}<\/h1>\n        <button onClick={increment}>Increment<\/button>\n    <\/div>\n);\n\nconst mapStateToProps = (state) => ({ count: state });\nconst mapDispatchToProps = { increment };\n\nconst ConnectedCounter = connect(mapStateToProps, mapDispatchToProps)(Counter);\n\n\/\/ App component\nconst App = () => (\n    <Provider store={store}>\n        <ConnectedCounter \/>\n    <\/Provider>\n);\n\nexport default App;\n<\/code><\/pre>\n<h4>Key Concepts of Redux<\/h4>\n<ul>\n<li>Action: A JavaScript object that describes what happened.<\/li>\n<li>Reducer: A function that changes the state based on the action.<\/li>\n<li>Store: An object that holds the application&#8217;s state.<\/li>\n<\/ul>\n<h3>3.2. Routing Library: React Router<\/h3>\n<p>React Router is a library used to implement client-side routing in React applications. It allows you to synchronize the URL with the UI, making it easy to manage various pages.<\/p>\n<pre><code>npm install react-router-dom<\/code><\/pre>\n<h4>Example Usage<\/h4>\n<p>Below is how to implement simple navigation using React Router.<\/p>\n<pre><code>\nimport React from 'react';\nimport { BrowserRouter as Router, Route, Switch, Link } from 'react-router-dom';\n\n\/\/ Page components\nconst Home = () => <h2>Home<\/h2>;\nconst About = () => <h2>About<\/h2>;\nconst NotFound = () => <h2>404 Not Found<\/h2>;\n\nconst App = () => (\n    <Router>\n        <nav>\n            <ul>\n                <li>\n                    <Link to=\"\/\">Home<\/Link>\n                <\/li>\n                <li>\n                    <Link to=\"\/about\">About<\/Link>\n                <\/li>\n            <\/ul>\n        <\/nav>\n        <Switch>\n            <Route component={Home} exact path=\"\/\" \/>\n            <Route component={About} path=\"\/about\" \/>\n            <Route component={NotFound} \/>\n        <\/Switch>\n    <\/Router>\n);\n\nexport default App;\n<\/code><\/pre>\n<h4>Key Concepts of React Router<\/h4>\n<ul>\n<li>Link: Creates a link to navigate to another page.<\/li>\n<li>Route: Defines which component to render based on the URL path.<\/li>\n<li>Switch: Renders only one of the multiple Routes.<\/li>\n<\/ul>\n<h3>3.3. Styling Library: Styled-Components<\/h3>\n<p>Styled-Components is a library used in React applications for writing CSS styles, providing a CSS-in-JS approach. This allows for more intuitive management of component styles.<\/p>\n<pre><code>npm install styled-components<\/code><\/pre>\n<h4>Example Usage<\/h4>\n<p>Below is how to create a simple button component using Styled-Components.<\/p>\n<pre><code>\nimport React from 'react';\nimport styled from 'styled-components';\n\n\/\/ Define button component style\nconst Button = styled.button`\n    background-color: #007bff;\n    color: white;\n    font-size: 16px;\n    padding: 10px 20px;\n    border: none;\n    border-radius: 5px;\n    cursor: pointer;\n\n    &:hover {\n        background-color: #0056b3;\n    }\n`;\n\nconst App = () => (\n    <Button>Click Me<\/Button>\n);\n\nexport default App;\n<\/code><\/pre>\n<h4>Advantages of Styled-Components<\/h4>\n<ul>\n<li>Encapsulates styles within components, making code management easier.<\/li>\n<li>Supports dynamic styling, allowing styles to adjust based on props.<\/li>\n<\/ul>\n<h2>4. Conclusion<\/h2>\n<p>In this tutorial, we examined several useful libraries that can be used with React. By managing state with Redux, implementing page navigation with React Router, and simplifying styling with Styled-Components, you can significantly enhance the scalability and maintainability of your React applications.<\/p>\n<p>Make the most of React&#8217;s powerful ecosystem to develop better web applications!<\/p>\n<p><\/body><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello! In this article, we will explore how to use and utilize various libraries in React. React is a powerful JavaScript library for building UIs, which can be used alongside various third-party libraries to create more efficient and convenient workflows. In this tutorial, we will introduce some popular libraries that can be used with React &hellip; <a href=\"https:\/\/atmokpo.com\/w\/32861\/\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;React Course: Using Libraries&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[123],"tags":[],"class_list":["post-32861","post","type-post","status-publish","format-standard","hentry","category-react-basics-course"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>React Course: Using Libraries - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/atmokpo.com\/w\/32861\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"React Course: Using Libraries - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"og:description\" content=\"Hello! In this article, we will explore how to use and utilize various libraries in React. React is a powerful JavaScript library for building UIs, which can be used alongside various third-party libraries to create more efficient and convenient workflows. In this tutorial, we will introduce some popular libraries that can be used with React &hellip; \ub354 \ubcf4\uae30 &quot;React Course: Using Libraries&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/atmokpo.com\/w\/32861\/\" \/>\n<meta property=\"og:site_name\" content=\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-01T09:12:03+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-01T11:21:42+00:00\" \/>\n<meta name=\"author\" content=\"root\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@bebubo4\" \/>\n<meta name=\"twitter:site\" content=\"@bebubo4\" \/>\n<meta name=\"twitter:label1\" content=\"\uae00\uc4f4\uc774\" \/>\n\t<meta name=\"twitter:data1\" content=\"root\" \/>\n\t<meta name=\"twitter:label2\" content=\"\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04\" \/>\n\t<meta name=\"twitter:data2\" content=\"3\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/atmokpo.com\/w\/32861\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/32861\/\"},\"author\":{\"name\":\"root\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\"},\"headline\":\"React Course: Using Libraries\",\"datePublished\":\"2024-11-01T09:12:03+00:00\",\"dateModified\":\"2024-11-01T11:21:42+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/atmokpo.com\/w\/32861\/\"},\"wordCount\":446,\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"articleSection\":[\"React basics course\"],\"inLanguage\":\"ko-KR\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/atmokpo.com\/w\/32861\/\",\"url\":\"https:\/\/atmokpo.com\/w\/32861\/\",\"name\":\"React Course: Using Libraries - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#website\"},\"datePublished\":\"2024-11-01T09:12:03+00:00\",\"dateModified\":\"2024-11-01T11:21:42+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/atmokpo.com\/w\/32861\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/atmokpo.com\/w\/32861\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/atmokpo.com\/w\/32861\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\ud648\",\"item\":\"https:\/\/atmokpo.com\/w\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"React Course: Using Libraries\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/atmokpo.com\/w\/#website\",\"url\":\"https:\/\/atmokpo.com\/w\/\",\"name\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/atmokpo.com\/w\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ko-KR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\",\"name\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"url\":\"https:\/\/atmokpo.com\/w\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png\",\"contentUrl\":\"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png\",\"width\":400,\"height\":400,\"caption\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\"},\"image\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/bebubo4\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\",\"name\":\"root\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g\",\"caption\":\"root\"},\"sameAs\":[\"http:\/\/atmokpo.com\/w\"],\"url\":\"https:\/\/atmokpo.com\/w\/author\/root\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"React Course: Using Libraries - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/atmokpo.com\/w\/32861\/","og_locale":"ko_KR","og_type":"article","og_title":"React Course: Using Libraries - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","og_description":"Hello! In this article, we will explore how to use and utilize various libraries in React. React is a powerful JavaScript library for building UIs, which can be used alongside various third-party libraries to create more efficient and convenient workflows. In this tutorial, we will introduce some popular libraries that can be used with React &hellip; \ub354 \ubcf4\uae30 \"React Course: Using Libraries\"","og_url":"https:\/\/atmokpo.com\/w\/32861\/","og_site_name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","article_published_time":"2024-11-01T09:12:03+00:00","article_modified_time":"2024-11-01T11:21:42+00:00","author":"root","twitter_card":"summary_large_image","twitter_creator":"@bebubo4","twitter_site":"@bebubo4","twitter_misc":{"\uae00\uc4f4\uc774":"root","\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04":"3\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/atmokpo.com\/w\/32861\/#article","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/32861\/"},"author":{"name":"root","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7"},"headline":"React Course: Using Libraries","datePublished":"2024-11-01T09:12:03+00:00","dateModified":"2024-11-01T11:21:42+00:00","mainEntityOfPage":{"@id":"https:\/\/atmokpo.com\/w\/32861\/"},"wordCount":446,"publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"articleSection":["React basics course"],"inLanguage":"ko-KR"},{"@type":"WebPage","@id":"https:\/\/atmokpo.com\/w\/32861\/","url":"https:\/\/atmokpo.com\/w\/32861\/","name":"React Course: Using Libraries - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/#website"},"datePublished":"2024-11-01T09:12:03+00:00","dateModified":"2024-11-01T11:21:42+00:00","breadcrumb":{"@id":"https:\/\/atmokpo.com\/w\/32861\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/atmokpo.com\/w\/32861\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/atmokpo.com\/w\/32861\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\ud648","item":"https:\/\/atmokpo.com\/w\/en\/"},{"@type":"ListItem","position":2,"name":"React Course: Using Libraries"}]},{"@type":"WebSite","@id":"https:\/\/atmokpo.com\/w\/#website","url":"https:\/\/atmokpo.com\/w\/","name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","description":"","publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/atmokpo.com\/w\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ko-KR"},{"@type":"Organization","@id":"https:\/\/atmokpo.com\/w\/#organization","name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","url":"https:\/\/atmokpo.com\/w\/","logo":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/","url":"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png","contentUrl":"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png","width":400,"height":400,"caption":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8"},"image":{"@id":"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/bebubo4"]},{"@type":"Person","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7","name":"root","image":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g","caption":"root"},"sameAs":["http:\/\/atmokpo.com\/w"],"url":"https:\/\/atmokpo.com\/w\/author\/root\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/32861","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/comments?post=32861"}],"version-history":[{"count":1,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/32861\/revisions"}],"predecessor-version":[{"id":32862,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/32861\/revisions\/32862"}],"wp:attachment":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/media?parent=32861"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/categories?post=32861"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/tags?post=32861"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}