{"id":32937,"date":"2024-11-01T09:12:36","date_gmt":"2024-11-01T09:12:36","guid":{"rendered":"http:\/\/atmokpo.com\/w\/?p=32937"},"modified":"2024-11-01T11:21:24","modified_gmt":"2024-11-01T11:21:24","slug":"react-course-first-encounter-with-javascript","status":"publish","type":"post","link":"https:\/\/atmokpo.com\/w\/32937\/","title":{"rendered":"React Course: First Encounter with JavaScript"},"content":{"rendered":"<p><body><\/p>\n<div class=\"container\">\n<p>Hello! In this course, we will delve deeply into React and JavaScript. The React we will use is a component-based library that is very useful for building user interfaces (UI). At the same time, JavaScript is a language that is essential for understanding and utilizing React. We will start with the basic concepts of JavaScript for those who are new to it.<\/p>\n<h2>1. Understanding JavaScript<\/h2>\n<p>JavaScript is the most widely used programming language in web development. It has become one of the core technologies of the web, alongside HTML and CSS. With JavaScript, we can add dynamic features to web pages and allow for interaction with users.<\/p>\n<h3>1.1 History of JavaScript<\/h3>\n<p>JavaScript was first developed by Brendan Eich in 1995. Initially, it was used for writing simple scripts within browsers, but over time it began to be used for developing complex applications as well.<\/p>\n<h3>1.2 Basic Syntax of JavaScript<\/h3>\n<ul>\n<li><strong>Variable Declaration:<\/strong> To declare a variable, we use <code>var<\/code>, <code>let<\/code>, and <code>const<\/code>. <code>let<\/code> and <code>const<\/code> have block scope, and <code>const<\/code> declares a constant that cannot be reassigned.<\/li>\n<li><strong>Data Types:<\/strong> JavaScript supports various data types. The main data types are as follows:\n<ul>\n<li>Number<\/li>\n<li>String<\/li>\n<li>Boolean<\/li>\n<li>Object<\/li>\n<li>Array<\/li>\n<li>Null<\/li>\n<li>Undefined<\/li>\n<\/ul>\n<\/li>\n<li><strong>Function:<\/strong> To define a function, we write as follows:\n<pre><code>function sayHello(name) {\n    return \"Hello, \" + name + \"!\";\n}<\/code><\/pre>\n<\/li>\n<\/ul>\n<h2>2. Understanding React<\/h2>\n<p>React is a JavaScript library developed by Facebook, which is very useful for building user interfaces. React allows us to manage the UI by breaking it down into independent pieces (components) using a component-based structure.<\/p>\n<h3>2.1 Features of React<\/h3>\n<ul>\n<li><strong>Component-Based:<\/strong> The UI of the application can be divided into multiple independent components, making it easier to manage.<\/li>\n<li><strong>Virtual DOM:<\/strong> React uses a virtual DOM to minimize changes to the actual DOM and optimize performance.<\/li>\n<li><strong>One-Way Data Binding:<\/strong> Data flows from parent components to child components, which makes the flow of data clear.<\/li>\n<\/ul>\n<h3>2.2 Installing and Setting Up React<\/h3>\n<p>To use React, you need to install Node.js and npm (Node Package Manager). After installation, you can create a new React project using the following command:<\/p>\n<pre><code>npx create-react-app my-app<\/code><\/pre>\n<p>Now, navigate to the project directory:<\/p>\n<pre><code>cd my-app<\/code><\/pre>\n<h2>3. Creating Your First React Component<\/h2>\n<p>Now let&#8217;s create a React component. Basic React components are defined as JavaScript functions or classes. Here is an example of creating a functional component:<\/p>\n<pre><code>import React from 'react';\n\nfunction HelloWorld() {\n    return <h1>Hello, React!<\/h1>;\n}\n\nexport default HelloWorld;<\/code><\/pre>\n<p>In the code above, we define a component called <code>HelloWorld<\/code>, which displays the phrase &#8220;Hello, React!&#8221; on the screen.<\/p>\n<h3>3.1 Using Components<\/h3>\n<p>To use the created component in another file, you can import it and use it as a JSX tag. For example:<\/p>\n<pre><code>import HelloWorld from '.\/HelloWorld';\n\nfunction App() {\n    return (\n        <div>\n            <HelloWorld><\/HelloWorld>\n        <\/div>\n    );\n}\n\nexport default App;<\/code><\/pre>\n<h2>4. Understanding JSX<\/h2>\n<p>In React, we use JSX (JavaScript XML) to define the UI. JSX is a syntax that allows you to write HTML within JavaScript code. Using JSX makes the code more readable.<\/p>\n<h3>4.1 JSX Syntax<\/h3>\n<ul>\n<li>JSX is similar to HTML, but you must use className instead of class.<\/li>\n<li>You can insert JavaScript expressions into tags using curly braces (<code>{}<\/code>).<\/li>\n<li>To return multiple JSX elements, they must be wrapped in a single parent element.<\/li>\n<\/ul>\n<h2>5. State Management and Lifecycle<\/h2>\n<p>In React, you can manage the state of a component and control the creation and destruction of a component through lifecycle methods.<\/p>\n<h3>5.1 State Management<\/h3>\n<pre><code>import React, { useState } from 'react';\n\nfunction Counter() {\n    const [count, setCount] = useState(0);\n\n    return (\n        <div>\n            <p>Current Count: {count}<\/p>\n            <button onClick={() => setCount(count + 1)}>Increase<\/button>\n        <\/div>\n    );\n}\n\nexport default Counter;<\/code><\/pre>\n<p>In the example above, we are managing the component&#8217;s state using the <code>useState<\/code> hook. The count increases each time the button is clicked.<\/p>\n<h3>5.2 Lifecycle Methods<\/h3>\n<p>Lifecycle methods are methods called during the creation, updating, and destruction of a component. In class components, you can use the following lifecycle methods:<\/p>\n<pre><code>class MyComponent extends React.Component {\n    componentDidMount() {\n        console.log('The component has been mounted.');\n    }\n\n    componentDidUpdate() {\n        console.log('The component has been updated.');\n    }\n\n    componentWillUnmount() {\n        console.log('The component will unmount.');\n    }\n\n    render() {\n        return <h1>React Lifecycle<\/h1>;\n    }\n}<\/code><\/pre>\n<h2>6. Event Handling<\/h2>\n<p>In React, handling HTML events is very straightforward. When handling events, you use properties like onClick or onChange.<\/p>\n<pre><code>function App() {\n    const handleClick = () => {\n        alert('The button has been clicked!');\n    };\n\n    return <button onClick={handleClick}>Click Here<\/button>;\n}<\/code><\/pre>\n<h2>7. Using External APIs<\/h2>\n<p>Let&#8217;s learn how to communicate with external APIs using React. For example, using fetch() to retrieve data.<\/p>\n<pre><code>import React, { useState, useEffect } from 'react';\n\nfunction DataFetching() {\n    const [data, setData] = useState([]);\n\n    useEffect(() => {\n        fetch('https:\/\/jsonplaceholder.typicode.com\/posts')\n            .then(response => response.json())\n            .then(data => setData(data));\n    }, []);\n\n    return (\n        <ul>\n            {data.map(post => (\n                <li key={post.id}>{post.title}<\/li>\n            ))}\n        <\/ul>\n    );\n}\n\nexport default DataFetching;<\/code><\/pre>\n<h2>8. Conclusion<\/h2>\n<p>In this course, we explored the basic concepts of React and JavaScript in depth. React is one of the most important technologies in modern web development. In the future, you will learn more about how to utilize and optimize it. I hope the journey to learn React will be helpful for you!<\/p>\n<h3>References<\/h3>\n<ul>\n<li><a href=\"https:\/\/reactjs.org\/docs\/getting-started.html\" target=\"_blank\" rel=\"noopener\">Official React Documentation<\/a><\/li>\n<li><a href=\"https:\/\/developer.mozilla.org\/ko\/docs\/Web\/JavaScript\" target=\"_blank\" rel=\"noopener\">JavaScript MDN Documentation<\/a><\/li>\n<li><a href=\"https:\/\/www.freecodecamp.org\/\" target=\"_blank\" rel=\"noopener\">Free Code Camp<\/a><\/li>\n<\/ul>\n<\/div>\n<p><\/body><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello! In this course, we will delve deeply into React and JavaScript. The React we will use is a component-based library that is very useful for building user interfaces (UI). At the same time, JavaScript is a language that is essential for understanding and utilizing React. We will start with the basic concepts of JavaScript &hellip; <a href=\"https:\/\/atmokpo.com\/w\/32937\/\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;React Course: First Encounter with JavaScript&#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-32937","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: First Encounter with JavaScript - \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\/32937\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"React Course: First Encounter with JavaScript - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"og:description\" content=\"Hello! In this course, we will delve deeply into React and JavaScript. The React we will use is a component-based library that is very useful for building user interfaces (UI). At the same time, JavaScript is a language that is essential for understanding and utilizing React. We will start with the basic concepts of JavaScript &hellip; \ub354 \ubcf4\uae30 &quot;React Course: First Encounter with JavaScript&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/atmokpo.com\/w\/32937\/\" \/>\n<meta property=\"og:site_name\" content=\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-01T09:12:36+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-01T11:21:24+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=\"4\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/atmokpo.com\/w\/32937\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/32937\/\"},\"author\":{\"name\":\"root\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\"},\"headline\":\"React Course: First Encounter with JavaScript\",\"datePublished\":\"2024-11-01T09:12:36+00:00\",\"dateModified\":\"2024-11-01T11:21:24+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/atmokpo.com\/w\/32937\/\"},\"wordCount\":658,\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"articleSection\":[\"React basics course\"],\"inLanguage\":\"ko-KR\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/atmokpo.com\/w\/32937\/\",\"url\":\"https:\/\/atmokpo.com\/w\/32937\/\",\"name\":\"React Course: First Encounter with JavaScript - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#website\"},\"datePublished\":\"2024-11-01T09:12:36+00:00\",\"dateModified\":\"2024-11-01T11:21:24+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/atmokpo.com\/w\/32937\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/atmokpo.com\/w\/32937\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/atmokpo.com\/w\/32937\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\ud648\",\"item\":\"https:\/\/atmokpo.com\/w\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"React Course: First Encounter with JavaScript\"}]},{\"@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: First Encounter with JavaScript - \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\/32937\/","og_locale":"ko_KR","og_type":"article","og_title":"React Course: First Encounter with JavaScript - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","og_description":"Hello! In this course, we will delve deeply into React and JavaScript. The React we will use is a component-based library that is very useful for building user interfaces (UI). At the same time, JavaScript is a language that is essential for understanding and utilizing React. We will start with the basic concepts of JavaScript &hellip; \ub354 \ubcf4\uae30 \"React Course: First Encounter with JavaScript\"","og_url":"https:\/\/atmokpo.com\/w\/32937\/","og_site_name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","article_published_time":"2024-11-01T09:12:36+00:00","article_modified_time":"2024-11-01T11:21:24+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":"4\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/atmokpo.com\/w\/32937\/#article","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/32937\/"},"author":{"name":"root","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7"},"headline":"React Course: First Encounter with JavaScript","datePublished":"2024-11-01T09:12:36+00:00","dateModified":"2024-11-01T11:21:24+00:00","mainEntityOfPage":{"@id":"https:\/\/atmokpo.com\/w\/32937\/"},"wordCount":658,"publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"articleSection":["React basics course"],"inLanguage":"ko-KR"},{"@type":"WebPage","@id":"https:\/\/atmokpo.com\/w\/32937\/","url":"https:\/\/atmokpo.com\/w\/32937\/","name":"React Course: First Encounter with JavaScript - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/#website"},"datePublished":"2024-11-01T09:12:36+00:00","dateModified":"2024-11-01T11:21:24+00:00","breadcrumb":{"@id":"https:\/\/atmokpo.com\/w\/32937\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/atmokpo.com\/w\/32937\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/atmokpo.com\/w\/32937\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\ud648","item":"https:\/\/atmokpo.com\/w\/en\/"},{"@type":"ListItem","position":2,"name":"React Course: First Encounter with JavaScript"}]},{"@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\/32937","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=32937"}],"version-history":[{"count":1,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/32937\/revisions"}],"predecessor-version":[{"id":32938,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/32937\/revisions\/32938"}],"wp:attachment":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/media?parent=32937"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/categories?post=32937"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/tags?post=32937"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}