<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>NS쇼핑 기술 블로그</title>
    <description>삶의 가치 창출과 행복나눔
</description>
    <link>http://nsshopping.github.io/</link>
    <atom:link href="http://nsshopping.github.io/rss" rel="self" type="application/rss+xml"/>
    <pubDate>Mon, 11 Mar 2019 13:48:32 +0900</pubDate>
    <lastBuildDate>Mon, 11 Mar 2019 13:48:32 +0900</lastBuildDate>
    <generator>Jekyll v3.7.4</generator>
    
      <item>
        <title>React - JSX</title>
        <description>&lt;h1 id=&quot;jsx란&quot;&gt;JSX란?&lt;/h1&gt;
&lt;p&gt;React.js 는 일반 JavaScript 문법이 아닌 JSX 문법을 사용하여 UI를 템플릿화 한다.  &lt;br /&gt;
JSX로 작성된 코드는 나중에 번들링되면서 babel-loder를 통해 자바스크립트로 변환한다.  &lt;br /&gt;
JSX를 사용하는것이 필수는 아니지만 이를 사용하면 다음과 같은 장점있다.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-list&quot;&gt;1. 보기에 익숙하다(가독성이 좋다)
2. 컴파일시 오류 감지
3. HTML 사용하듯이 사용
&lt;/code&gt;&lt;/pre&gt;

&lt;h4 id=&quot;jsx&quot;&gt;JSX&lt;/h4&gt;
&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;soo&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;h1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;안녕하세요&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;/h1&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&amp;gt;
&lt;/span&gt;    &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;/div&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&amp;gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;바벨로 변환하면 다음과 같다.&lt;/p&gt;
&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;soo&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;React&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;createElement&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&quot;div&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;kc&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;React&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;createElement&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
        &lt;span class=&quot;s2&quot;&gt;&quot;h1&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;kc&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;s2&quot;&gt;&quot;안녕하세요&quot;&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;문법&quot;&gt;문법&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;- 부모 Element&lt;/strong&gt;  &lt;br /&gt;
컴포넌트에 여러 Element가 있다면 부모 Element 하나로 꼭 감싸야 한다.  &lt;br /&gt;
다음코드는 오류를 발생한다.&lt;/p&gt;
&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;React&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Component&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'react'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;kd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;App&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Component&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;render&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
      &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;안녕하세요&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;/p&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&amp;gt;
&lt;/span&gt;      &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;잘지내시죠&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;?&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;/p&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&amp;gt;
&lt;/span&gt;    &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;default&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;App&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;부모 Element를 감싸주면 오류가 해결된다.&lt;/p&gt;
&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;React&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Component&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'react'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;kd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;App&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Component&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;render&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
        &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;안녕하세요&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;/p&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&amp;gt;
&lt;/span&gt;            &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;잘지내시죠&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;?&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;/p&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&amp;gt;
&lt;/span&gt;        &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;/div&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&amp;gt;
&lt;/span&gt;    &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;default&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;App&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;- Fragment&lt;/strong&gt;  &lt;br /&gt;
리액트 v16이상에서는 Fragment가 생겼다.  &lt;br /&gt;
Fragment를 사용하면 &lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;lt;div&amp;gt;&lt;/code&gt; 요소를 감싸지 않아도 여러 Element가 렌더링 된다.&lt;/p&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;React&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Component&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Fragment&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'react'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;kd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;App&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Component&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;render&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
        &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;Fragment&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;안녕하세요&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;/p&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&amp;gt;
&lt;/span&gt;            &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;잘지내시죠&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;?&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;/p&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&amp;gt;
&lt;/span&gt;        &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;/Fragment&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&amp;gt;
&lt;/span&gt;    &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;default&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;App&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;- 자바스트립트 표현&lt;/strong&gt;  &lt;br /&gt;
JSX가 단순이 DOM 렌더딩 이외에 자바스크립트 표현식을 쓸 수 있으며 코드를 &lt;code class=&quot;highlighter-rouge&quot;&gt;{}&lt;/code&gt; 감싸면 된다. 
{text} 자바스크립트 선언이 렌더링 된다.&lt;/p&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;React&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Component&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Fragment&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'react'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;kd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;App&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Component&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;render&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;text&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;안녕하세요&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
        &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;Fragment&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;/p&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&amp;gt;
&lt;/span&gt;            &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;잘지내시죠&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;?&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;/p&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&amp;gt;
&lt;/span&gt;        &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;/Fragment&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&amp;gt;
&lt;/span&gt;    &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;default&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;App&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;- 조건부 연산자&lt;/strong&gt;  &lt;br /&gt;
자바스크립트 표현식 if문를 사용할 수 없지만, 조건에 따라 렌더링 해야할때 {} 안에 연산자를 사용하면 된다. 
name 값이 조미미 일 경우 &lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;lt;p&amp;gt;맞음&amp;lt;/p&amp;gt;&lt;/code&gt; 이 렌더링 될 것이다.&lt;/p&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;React&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Component&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'react'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;kd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;App&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Component&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;render&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;text&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;안녕하세요&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;조미미&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
        &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;===&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;조미미&quot;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;?&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;맞음&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;/p&amp;gt; : &amp;lt;p&amp;gt;아님&amp;lt;/&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;/p&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&amp;gt;
&lt;/span&gt;            &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;잘지내시죠&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;?&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;/p&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&amp;gt;
&lt;/span&gt;        &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;/div&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&amp;gt;
&lt;/span&gt;    &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;default&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;App&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;특정 조건를 만족할때 만족하지 않을때 각각 다른 결과를 보여주어야 할때는 상위에 쓴 조건부 연산자를 사용하는게 맞다.
하지만 특정 조건일때만 보여주고싶다면 &lt;code class=&quot;highlighter-rouge&quot;&gt;{name === &quot;조미미&quot; &amp;amp;&amp;amp; &amp;lt;p&amp;gt;이력확인&amp;lt;/p&amp;gt;}&lt;/code&gt; &amp;amp;&amp;amp; 연산자로 조건부 처리하면 된다.&lt;/p&gt;

&lt;p&gt;**- class대신 className 사용  &lt;br /&gt;
다음과 같이 div에 &lt;code class=&quot;highlighter-rouge&quot;&gt;class&lt;/code&gt;를 사용하면 경고 메세지를 표시한다. 이미 class 자바스크립트 키워드에 있기 때문이다. 
Component를 선언할때 &lt;code class=&quot;highlighter-rouge&quot;&gt;class&lt;/code&gt;가 사용된다.&lt;/p&gt;

&lt;div class=&quot;language-diff highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;import React, { Component } from 'react';

class App extends Component {
  render() {
    return (
&lt;span class=&quot;gd&quot;&gt;-        &amp;lt;div class=&quot;inText&quot;&amp;gt;
&lt;/span&gt;&lt;span class=&quot;gi&quot;&gt;+        &amp;lt;div className=&quot;inText&quot;&amp;gt;
&lt;/span&gt;            &amp;lt;p&amp;gt;잘지내시죠?&amp;lt;/p&amp;gt;
        &amp;lt;/div&amp;gt;
    );
  }
}

export default App;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;**- inline style 사용  &lt;br /&gt;
리액트 DOM요소에 스타일을 적용할때 문자열로 적용할 수 없다. 대신에 자바스크립트 객체형으로 만들어서 적용해야한다. 
이때 key값은 카멜표기법으로 작성되어야 한다.&lt;/p&gt;
&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;React&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Component&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'react'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;kd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;App&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Component&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;render&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;style&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;backgroundColor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'#f1f1f1'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;fontSize&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'12px'&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
        &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;안녕하세요&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;/p&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&amp;gt;
&lt;/span&gt;            &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;잘지내시죠&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;?&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;/p&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&amp;gt;
&lt;/span&gt;        &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;/div&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&amp;gt;
&lt;/span&gt;    &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;default&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;App&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;**- 닫기태그  &lt;br /&gt;
HTML 코드를 작성할때 닫기태그를 작성하지 않는 경우가 있는데, 예로 &lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;lt;input&amp;gt; &amp;lt;br&amp;gt;&lt;/code&gt;등이 있다. &lt;br /&gt;
JSX에서는 꼭 닫기 태그를 닫아줘야한다.&lt;/p&gt;
&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;br&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;input&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;search&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;**- 주석처리  &lt;br /&gt;
JSX에서 사용되는 주석은 일반적인 주석처리와 다르다.&lt;/p&gt;
&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;cm&quot;&gt;/* 요소밖 주석처리 */&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;p&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;className&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;greeting&quot;&lt;/span&gt;
    &lt;span class=&quot;cm&quot;&gt;/* 요소안에서만 사용하는 주석 */&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// 마지막 &amp;gt;가 꼭 새 줄에 있어야함&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;err&quot;&gt;안녕하세요&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;/p&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&amp;gt;
&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;/div&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</description>
        <pubDate>Fri, 22 Feb 2019 22:45:00 +0900</pubDate>
        <link>http://nsshopping.github.io/2019/02/22/about-jsx/</link>
        <guid isPermaLink="true">http://nsshopping.github.io/2019/02/22/about-jsx/</guid>
        
        <category>study</category>
        
        
      </item>
    
      <item>
        <title>React 시작하기</title>
        <description>&lt;h1 id=&quot;react-시작하기&quot;&gt;React 시작하기&lt;/h1&gt;
&lt;p&gt;React.. 첫 시작은 검색.. 수많은 문서, 예제들이 쏟아져 나왔다. 눈으로 읽고 보고 또 보아도 머릿속에 들어오지 않지만 하나씩 시작해보려고 한다.&lt;/p&gt;

&lt;p&gt;React 는 프레임워크가 아닌 자바스크립트 라이브러리로 사용자 인터페이스를 만드는데 사용한다.
구조가 MVC, MVW 등인 프레임워크와 달리, 오직 View 만 신경 쓰는 라이브러리이다.&lt;/p&gt;

&lt;h4 id=&quot;component&quot;&gt;Component&lt;/h4&gt;
&lt;p&gt;가장 먼저 알아야 하는 것은 React 의 컴포넌트. 
React 컴포넌트는 render()에서 새로운 DOM 트리를 생성하고, 이전 DOM 트리와 비교하여 변경 점을 찾아 업데이트한다.
하나에 컴포넌트에서 해당 생김새와 작동방식을 정의하고 컴포넌트 내부에는 또 다른 컴포넌트를 추가 해서 사용할 수도 있다.  &lt;br /&gt;
사용자 화면에 뷰를 보여 주는 것을 렌더링이라 한다. 각 컴포넌트는 &lt;code class=&quot;highlighter-rouge&quot;&gt;render()&lt;/code&gt; 메소드를 통해 뷰를 그리는데 &lt;code class=&quot;highlighter-rouge&quot;&gt;초기렌더링&lt;/code&gt;과 컴포넌트 데이터 변경으로 다시 실행되는 &lt;code class=&quot;highlighter-rouge&quot;&gt;리렌더링&lt;/code&gt;을 알아야 한다.&lt;/p&gt;

&lt;h4 id=&quot;render&quot;&gt;Render&lt;/h4&gt;
&lt;p&gt;리액트에는 &lt;code class=&quot;highlighter-rouge&quot;&gt;render()&lt;/code&gt; 함수가 있다. 
이 함수는 컴포넌트를 정의하는 역할을 하며, 뷰가 어떻게 생겼고, 어떻게 작동하는지 정보를 지닌 객체를 반환한다.&lt;/p&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nx&quot;&gt;render&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{...}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;render()&lt;/code&gt; 함수를 실행하면 컴포넌트의 렌더링 -&amp;gt; Reconciliation 작업 -&amp;gt; DOM 조작 작업 -&amp;gt; 이벤트가 적용된다.&lt;/p&gt;

&lt;h4 id=&quot;reconciliation&quot;&gt;Reconciliation&lt;/h4&gt;
&lt;p&gt;간단히 말하면 변화에 대한 전/후 DOM 트리를 비교(Diff)하여 갱신이 필요한 부분만을 찾아 DOM 트리를 업데이트하는 것을 의미한다.&lt;/p&gt;

&lt;p&gt;변화에 따라 뷰가 변형된 것처럼 보이지만 실제로는 새로운 요소로 갈아 끼운다. 이 작업 또한 &lt;code class=&quot;highlighter-rouge&quot;&gt;render()&lt;/code&gt; 에서 진행한다.&lt;/p&gt;

&lt;p&gt;컴포넌트는 데이터를 업데이트 했을 때 단순히 업데이트 값만 수정하는 것이 아니라 새로운 데이터를 가지고 &lt;code class=&quot;highlighter-rouge&quot;&gt;render()&lt;/code&gt; 함수를 또다시 호출하고 이때 바로 DOM에 반영하지 않고 이전 &lt;code class=&quot;highlighter-rouge&quot;&gt;render()&lt;/code&gt; 함수가 만들었던 컴포넌트 정보와 현재 &lt;code class=&quot;highlighter-rouge&quot;&gt;render()&lt;/code&gt; 정보의 차이점만 비교해서 최소한의 자원을 사용하여 이를 수행한다.&lt;/p&gt;

&lt;h4 id=&quot;virtual-dom&quot;&gt;Virtual DOM&lt;/h4&gt;
&lt;p&gt;리액트의 특징 중 하나가 Virtual DOM(가상 DOM) 을 사용하는 것이다.&lt;/p&gt;

&lt;p&gt;웹브라우저에서는 DOM 에 조작을 가할 때마다 렌더링을 시키게 되는데, DOM 조작할 때마다 새로 렌더링이 되면 성능이 느려질 수밖에 없다. 
리액트에서는 한 번의 상태변경으로 여러 곳의 DOM 이 변경된다고 해도 Virtual DOM 방식을 사용하여 가상화한 DOM에서 전부 변경하고 이전 DOM과 비교해서 변경된 부분을 한 번에 적용하는 방식으로 DOM 렌더링횟수를 최소화하고 효율적으로 진행한다.&lt;/p&gt;

&lt;p&gt;리액트에서 데이터가 변화하여 웹 브라우저에서 실제 DOM 을 업데이트할 때, 웹 브라우저에 DOM 을 새로 넣는 것이 아니라, 다음과 같은 절차를 밟는다.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;데이터를 업데이트하면 중간에 가상 DOM 에 한번 리렌더링을 하고,&lt;/li&gt;
  &lt;li&gt;이전 DOM 트리 내용을 비교한 다음에&lt;/li&gt;
  &lt;li&gt;변경 부분에 대해서만 업데이트를 해준다.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;여기서 &lt;code class=&quot;highlighter-rouge&quot;&gt;새로운 DOM 트리&lt;/code&gt;가 바로 Virtual DOM 이다.&lt;/p&gt;

&lt;h4 id=&quot;etc&quot;&gt;etc&lt;/h4&gt;
&lt;p&gt;위에서 언급했듯이 일부 웹 프레임워크가 MVC 또는 MVW 등 구조를 지향하는 거와 달리 리액트는 뷰(Veiw)만 신경 쓰는 라이브러리로 데이터모델링, 라우팅 등 기타 기능은 직접 구현해서 사용해야 한다.&lt;/p&gt;

&lt;p&gt;React + (MobX, redux, SockJS, react-router…….) &lt;br /&gt;
수많은 라이브러리와 함께 사용할 수도 있고, 다른 웹 프레임워크와 혼용할 수도 있다.&lt;/p&gt;

&lt;p&gt;React + AngularJS  &lt;br /&gt;
React + Backbone.js  &lt;br /&gt;
React + …&lt;/p&gt;

&lt;h3 id=&quot;작업-환경설정&quot;&gt;작업 환경설정&lt;/h3&gt;

&lt;pre&gt;&lt;code class=&quot;language-list&quot;&gt;1. Node.js / npm or yarn 설치하기
2. Git 설치
3. create-react-app 으로 프로젝트 만들기
&lt;/code&gt;&lt;/pre&gt;

&lt;h3 id=&quot;nodejs와-npm&quot;&gt;Node.js와 npm&lt;/h3&gt;
&lt;p&gt;리액트 프로젝트를 만들 때는 Node.js 와 npm 를 꼭 설치해야한다. 
npm은 Node.js와 함께 설치되는데 Node.js 버전에 따라 npm 버전도 다르게 설치된다.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-info&quot;&gt;Node.js v8.12.0 를 사용하였다
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;nvm를 이용하면 Node.js를 여러 버전을 설치해서 사용할 수 있다.  &lt;br /&gt;
window 환경에서는 &lt;a href=&quot;https://github.com/coreybutler/nvm-windows&quot;&gt;nvm-window&lt;/a&gt;를 설치해서 이용하면 된다. 
설치가 끝나면 명령창에서 다음 명령어를 입력하여 제대로 설치되었는지 확인할 수 있다.&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;node -v
v8.12.0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;npm&lt;/code&gt;은 의존성 라이브러리 개수가 많으면 속도가 저하되기도 하는데 &lt;code class=&quot;highlighter-rouge&quot;&gt;yarn&lt;/code&gt; 은 &lt;code class=&quot;highlighter-rouge&quot;&gt;npm&lt;/code&gt;문제점을 개선한 패키지 매니저인데 나는 익숙한 &lt;code class=&quot;highlighter-rouge&quot;&gt;npm&lt;/code&gt; 를 사용하기로 했다.&lt;/p&gt;

&lt;h3 id=&quot;git-설치&quot;&gt;Git 설치&lt;/h3&gt;
&lt;p&gt;Git은 형상 관리 도구로 프로젝트 버전을 관리하고 협업할 때 매우 중요한 역할을 한다. 
Git 공식 홈페이지 &lt;a href=&quot;https://git-scm.com/download/mac&quot;&gt;https://git-scm.com/download/mac&lt;/a&gt; 에서 설치 파일을 받아 설치하면 된다.&lt;/p&gt;

&lt;h3 id=&quot;create-react-app으로-프로젝트-생성-및-실행&quot;&gt;create-react-app으로 프로젝트 생성 및 실행&lt;/h3&gt;
&lt;p&gt;create-react-app 는 react 웹 개발용 boilerplate 이다. create-react-app 글로벌로 설치한다. 
프로젝트를 만들 때는 &lt;code class=&quot;highlighter-rouge&quot;&gt;create-react-app {프로젝트이름}&lt;/code&gt; 명령어를 사용하면 된다.&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/facebook/create-react-app/tree/master/packages/react-scripts/template&quot;&gt;create-react-app&lt;/a&gt; 가이드 문서&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;npm install -g create-react-app 
create-react-app study-react
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;명령어를 입력하면 자동으로 모듈들이 설치된다.
&lt;code class=&quot;highlighter-rouge&quot;&gt;npm start&lt;/code&gt; 명령어로 개발 서버를 실행할 수 있다. 서버 포트는 3000번이며 파일을 수정하고 저장할 때마다 다시 빌드하고 웹 브라우저를 리로딩한다.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;npm start
&amp;gt; react-scripts start
Starting the development server...
Compiled successfully!
.
.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;이 과정이 완료되면 자동으로 http://&lt;span&gt;&lt;/span&gt;localhost:3000 페이지가 뜬다.&lt;/p&gt;

&lt;p&gt;아무런 설정없이 직접 모든 환경 Rect부터 설정하면 되겠지만, React는 ES6 버전의 Javascript로 작성하는 것이 일반화 되어있기 때문에 모듈번들러로 컴파일 및 빌드 하는 것이 필수라 이 환경을 세팅해줘야 하는 것도 상당한 일이다.  &lt;br /&gt;
Rect 에만 집중하고 싶으면 boilerplate 이용하여 입문하는 것도 좋을것 같다. 
이제 react 를 시작할 준비가 되었다.. 다음에는 react 코드를 작성해 봐야지..&lt;/p&gt;
</description>
        <pubDate>Sat, 16 Feb 2019 16:23:00 +0900</pubDate>
        <link>http://nsshopping.github.io/2019/02/16/about-react/</link>
        <guid isPermaLink="true">http://nsshopping.github.io/2019/02/16/about-react/</guid>
        
        <category>study</category>
        
        
      </item>
    
      <item>
        <title>1인 프로젝트: 게시판 만들기</title>
        <description>&lt;h1 id=&quot;게시판-만들기-프로젝트&quot;&gt;게시판 만들기 프로젝트&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;프로젝트 개요&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;개발 언어: Java 1.8&lt;/li&gt;
  &lt;li&gt;프레임워크: Spring 3.9.3&lt;/li&gt;
  &lt;li&gt;DB: MySQL 8.0&lt;/li&gt;
  &lt;li&gt;서버: Apache Tomcat 8.5&lt;/li&gt;
  &lt;li&gt;빌드툴: Maven&lt;/li&gt;
  &lt;li&gt;테스트: JUnit 4.12&lt;/li&gt;
  &lt;li&gt;ORM: Mybatis 3.4.6&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;환경 설정&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Maven dependencies (pom.xml 파일 수정)&lt;/li&gt;
  &lt;li&gt;MyBatis (root-context.xml 파일 수정, bean 추가, XML Mapper에 SQL 저장)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;구현 결과&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;DB 테이블
    &lt;ul&gt;
      &lt;li&gt;
        &lt;p&gt;tbl_post(게시물) 
&lt;img src=&quot;/files/img/tbl_post.png&quot; alt=&quot;tbl_post&quot; /&gt;&lt;/p&gt;
      &lt;/li&gt;
      &lt;li&gt;
        &lt;p&gt;tbl_user(사용자) 
&lt;img src=&quot;/files/img/tbl_user.png&quot; alt=&quot;tbl_user&quot; /&gt;&lt;/p&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;결과물 화면
    &lt;ul&gt;
      &lt;li&gt;
        &lt;p&gt;게시물(하단 페이징, 페이지 당 노출되는 게시물 10개로 설정) 
&lt;img src=&quot;/files/img/list.png&quot; alt=&quot;list&quot; /&gt;  &lt;br /&gt;
&lt;img src=&quot;/files/img/paging.png&quot; alt=&quot;paging&quot; /&gt;&lt;/p&gt;
      &lt;/li&gt;
      &lt;li&gt;
        &lt;p&gt;회원가입 
&lt;img src=&quot;/files/img/signup.png&quot; alt=&quot;signup&quot; /&gt;&lt;/p&gt;
      &lt;/li&gt;
      &lt;li&gt;
        &lt;p&gt;로그인  &lt;br /&gt;
&lt;img src=&quot;/files/img/login.png&quot; alt=&quot;login&quot; /&gt;&lt;/p&gt;
      &lt;/li&gt;
      &lt;li&gt;
        &lt;p&gt;글쓰기&lt;br /&gt;
&lt;img src=&quot;/files/img/register.png&quot; alt=&quot;register&quot; /&gt;&lt;/p&gt;
      &lt;/li&gt;
      &lt;li&gt;
        &lt;p&gt;게시글 조회 
&lt;img src=&quot;/files/img/readPage.png&quot; alt=&quot;readPage&quot; /&gt;&lt;/p&gt;
      &lt;/li&gt;
      &lt;li&gt;
        &lt;p&gt;검색기능(제목, 내용, 글쓴이 keyword로 검색가능)  &lt;br /&gt;
&lt;img src=&quot;/files/img/search.png&quot; alt=&quot;search&quot; /&gt;&lt;/p&gt;
      &lt;/li&gt;
      &lt;li&gt;
        &lt;p&gt;조회수
&lt;img src=&quot;/files/img/viewcount.png&quot; alt=&quot;viewcount&quot; /&gt;&lt;/p&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ol&gt;

</description>
        <pubDate>Fri, 01 Feb 2019 08:50:00 +0900</pubDate>
        <link>http://nsshopping.github.io/2019/02/01/jiyun-project/</link>
        <guid isPermaLink="true">http://nsshopping.github.io/2019/02/01/jiyun-project/</guid>
        
        <category>study</category>
        
        
      </item>
    
      <item>
        <title>팀블로그를 운영해봅시다</title>
        <description>&lt;h1 id=&quot;운영취지&quot;&gt;운영취지&lt;/h1&gt;
&lt;p&gt;기존의 회사 IT 팀들이 소통에 폐쇄적이었다면&lt;/p&gt;

&lt;p&gt;오픈소스와 협업에 눈을 뜨면서&lt;/p&gt;

&lt;p&gt;소통을 적극적으로 하려고 마음가짐이 바뀌었고&lt;/p&gt;

&lt;p&gt;적극적인 소통이야 말로 IT 팀내부의 구성원들 역량도&lt;/p&gt;

&lt;p&gt;함께 성장할 수 있다고 믿기에&lt;/p&gt;

&lt;p&gt;외부와의 소통 채널로 팀블로그를 깃허브에 운영해보려고 합니다&lt;/p&gt;

&lt;p&gt;부가적으로는 깃허브내에 기여하는 방법을 기본적으로 숙지시키려고 합니다&lt;/p&gt;
</description>
        <pubDate>Mon, 07 Jan 2019 09:20:13 +0900</pubDate>
        <link>http://nsshopping.github.io/2019/01/07/team-blog-start/</link>
        <guid isPermaLink="true">http://nsshopping.github.io/2019/01/07/team-blog-start/</guid>
        
        <category>study</category>
        
        
      </item>
    
      <item>
        <title>github 기본단어</title>
        <description>&lt;h2 id=&quot;git-단어&quot;&gt;git 단어&lt;/h2&gt;

&lt;p&gt;git init: 깃 저장소를 초기화한다.&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;저장소나 디렉토리 안에서 이 명령을 실행하기 전까지는 그냥 일반 폴더이다. 이것을 입력한 후에야 추가적인 깃 명령어들을 줄 수 있다.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;git config: “configure”의 준말, 처음에 깃을 설정할 때 가장 유용하다.&lt;/p&gt;

&lt;p&gt;git help: 명령어를 잊어버렸다? 커맨드 라인에 이걸 타이핑하면 21개의 가장 많이 사용하는 깃 명령어들이 나타난다.&lt;/p&gt;

&lt;p&gt;git status: 저장소 상태를 체크.&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;어떤 화일이 저장소 안에 있는지, 커밋이 필요한 변경사항이 있는지, 현재 저장소의 어떤 브랜치에서 작업하고 있는지 등을 볼 수 있다.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;git add: 이 명령이 저장소에 새 화일들을 추가하진 않는다.&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;대신, 깃이 새 화일들을 지켜보게 한다. 화일을 추가하면, 깃의 저장소 “스냅샷”에 포함된다.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;git commit: 깃의 가장 중요한 명령어.&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;어떤 변경사항이라도 만든 후, 저장소의 “스냅샷”을 찍기 위해 이것을 입력한다. 보통 “git commit -m “Message hear.” 형식으로 사용한다.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;git branch: 여러 협업자와 작업하고 자신만의 변경을 원한다?&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;이 명령어는 새로운 브랜치를 만들고, 자신만의 변경사항과 화일 추가 등의 커밋 타임라인을 만든다.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;git checkout: 글자 그대로, 현재 위치하고 있지 않은 저장소를 “체크아웃”할 수 있다.&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;이것은 체크하길 원하는 저장소로 옮겨가게 해주는 탐색 명령이다.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;git merge: 브랜치에서 작업을 끝내고, 모든 협업자가 볼 수 있는 master 브랜치로 병합할 수 있다.&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;git merge cats는 “cats” 브랜치에서 만든 모든 변경사항을 master로 추가한다.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;git push: 로컬 컴퓨터에서 작업하고 당신의 커밋을 깃허브에서 온라인으로도 볼 수 있기를 원한다면, 이 명령어로 깃허브에 변경사항을 “push”한다.&lt;/p&gt;

&lt;p&gt;git pull: 로컬 컴퓨터에서 작업할 때, 작업하고 있는 저장소의 최신 버전을 원하면, 이 명령어로 깃허브로부터 변경사항을 다운로드한다(“pull”).&lt;/p&gt;

</description>
        <pubDate>Fri, 28 Sep 2018 15:45:13 +0900</pubDate>
        <link>http://nsshopping.github.io/2018/09/28/gitstudy2-post/</link>
        <guid isPermaLink="true">http://nsshopping.github.io/2018/09/28/gitstudy2-post/</guid>
        
        <category>github</category>
        
        <category>study</category>
        
        <category>git</category>
        
        
      </item>
    
      <item>
        <title>github 교육시 유용한 기본명령어</title>
        <description>&lt;h2 id=&quot;github-교육&quot;&gt;github 교육&lt;/h2&gt;

&lt;p&gt;Git 기본 명령어들&lt;/p&gt;

&lt;p&gt;터미널에서 git –help를 입력하면 기본 사용법이 나오는데, 이 때 기본 명령어들에 대한 간단한 설명들이 나옵니다.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ git --help
작업 공간 시작하기
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;clone : 원격 저장소를 지역 디렉토리에 복제합니다.&lt;/p&gt;

&lt;p&gt;init : 비어있는 Git 저장소를 만들거나 기존에 있던 것을 초기화합니다.&lt;/p&gt;

&lt;p&gt;git help tutorial의 결과도 살펴볼 필요가 있습니다.&lt;/p&gt;

&lt;p&gt;현재의 변경에서 작업하기&lt;/p&gt;

&lt;p&gt;add : 파일 변경 내용을 인덱스에 추가합니다.&lt;/p&gt;

&lt;p&gt;mv : 파일, 디렉토리, 또는 (연결)링크를 옮기거나 이름을 변경합니다.&lt;/p&gt;

&lt;p&gt;reset : 현재 HEAD 를 특정한 상태로 재설정합니다.&lt;/p&gt;

&lt;p&gt;rm : 파일들을 작업 트리와 인덱스에서 제거합니다.&lt;/p&gt;

&lt;p&gt;git help everyday의 결과도 살펴볼 필요가 있습니다.&lt;/p&gt;

&lt;p&gt;변경 내력과 상태를 검사하기&lt;/p&gt;

&lt;p&gt;bisect : 버그를 알리는 커밋을 찾기 위해 이진 트리를 사용합니다.&lt;/p&gt;

&lt;p&gt;grep : 패턴과 들어맞는 라인들을 출력합니다.&lt;/p&gt;

&lt;p&gt;log : 커밋 로그들을 보여줍니다.&lt;/p&gt;

&lt;p&gt;show : 다양한 타입의 객체들을 보여줍니다.&lt;/p&gt;

&lt;p&gt;status : 작업 트리의 상태를 보여줍니다.&lt;/p&gt;

&lt;p&gt;git help revisions의 결과도 살펴볼 필요가 있습니다.&lt;/p&gt;

&lt;p&gt;변경 내력을 키우고, 표시하고, 비틀기&lt;/p&gt;

&lt;p&gt;branch : 브랜치들을 나열하고, 만들고, 또는 지웁니다.&lt;/p&gt;

&lt;p&gt;checkout : 브랜치들을 바꾸거나 작업 트리 파일들을 재저장합니다.&lt;/p&gt;

&lt;p&gt;commit : 변경 사항들을 저장소에 기록합니다.&lt;/p&gt;

&lt;p&gt;diff : 커밋들 또는 커밋과 작업 트리 사이의 변경 사항을 보여줍니다
.
merge : 두 개 또는 다수의 개발 변경 내력을 서로 합칩니다.&lt;/p&gt;

&lt;p&gt;rebase : Forward-port local commits to the updated upstream head&lt;/p&gt;

&lt;p&gt;tag : GPG로 표기된 태그 객체를 만들고, 나열하고, 지우고, 또는 확인합니다.&lt;/p&gt;

&lt;p&gt;협업하기&lt;/p&gt;

&lt;p&gt;fetch : 다른 저장소에서 객체들과 참조들을 다운로드 합니다.&lt;/p&gt;

&lt;p&gt;pull : 다른 저장소나 브랜치에서 fetch를 하고 취합합니다.&lt;/p&gt;

&lt;p&gt;push : 원격 참조들을 관련된 객체들을 가지고서 업데이트 합니다.&lt;/p&gt;
</description>
        <pubDate>Mon, 20 Nov 2017 14:20:13 +0900</pubDate>
        <link>http://nsshopping.github.io/2017/11/20/gitstudy-post/</link>
        <guid isPermaLink="true">http://nsshopping.github.io/2017/11/20/gitstudy-post/</guid>
        
        <category>github</category>
        
        <category>study</category>
        
        
      </item>
    
      <item>
        <title>GTM post</title>
        <description>&lt;h2 id=&quot;gtm-ga-ecommerce-연동&quot;&gt;GTM-GA ECOMMERCE 연동&lt;/h2&gt;

&lt;p&gt;기본적으로 GTM-GA-쇼핑몰 연동을 하셨다면&lt;/p&gt;

&lt;p&gt;향상된 전자상거래 항목을 어찌 추가해야하는지 어려움이 많으신 분들이 많을 것이라고 생각됩니다.&lt;/p&gt;

&lt;p&gt;차근차근 진행해보겠습니다.&lt;/p&gt;

&lt;p&gt;일단 개념부터 생각을 해볼까요?&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;전자상거래에 어떤 데이터를 전송할지 생각해보세요(ex. 구매완료된 상품을 GA로 보내고 싶어요!)&lt;/li&gt;
  &lt;li&gt;GTM에서 GA로 보낼 수 있는 TAG를 생성해야하겠군요 (ex. 구매완료 )&lt;/li&gt;
  &lt;li&gt;어떤 상황에서 TAG를 실행시킬 것인지 생각해서 만들어야합니다. (ex. pageURL에 구매완료페이지 이름이 들어가면 TAG를 실행시키고 싶어요)&lt;/li&gt;
  &lt;li&gt;전자상거래에 맞는 GTM에서 제시한 데이터를 setting해줘야 TAG에서 해당 데이터를 가져갈 수 있어요.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;개념은 위의 양식대로 생각했지만 순서는 반대로 하시면 되요.(사실 편하신대로 해도 관계없어요)&lt;/p&gt;

&lt;p&gt;구매완료를 추적하기 위해 GTM에서 제시한 데이터 setting을 먼저 해볼까요?&lt;/p&gt;

&lt;p&gt;GTM 공식 사이트에서는&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;hawoong12.github.io/images/gtm-ga_measuring_purchases.png&quot; alt=&quot;GTM&quot; /&gt;&lt;/p&gt;

&lt;p&gt;라고 나타나 있습니다. 이해하기가 쉽지 않죠.&lt;/p&gt;

&lt;p&gt;하지만 자세히 살펴보면 필요한 정보는 모두 포함하고 있어요.&lt;/p&gt;

&lt;p&gt;저 스크립트를 넣고 싶은 사이트에 넣어주면 되요.&lt;/p&gt;

&lt;p&gt;여기서 제일 중요한 점은 이 스크립트는 GTM스니펫(처음 스크립트 삽입하라고 주는 GTM설치스크립트)보다는 먼저 읽어져야 합니다.&lt;/p&gt;

&lt;p&gt;따라서 &amp;lt;head&amp;gt;부분에 선언했던 해당 GTM스니펫 스크립트를 구매완료 페이지에서는 &amp;lt;head&amp;gt;에서 호출 되지 않고&lt;/p&gt;

&lt;p&gt;dataLayer 선언 후 &amp;lt;body&amp;gt;에서 선언을 해야합니다.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;o&quot;&gt;&amp;lt;!--&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Google&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Tag&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Manager&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;--&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;((&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;URL&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;indexOf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'구매완료URL에반드시포함되는referrer중 하나'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;){&lt;/span&gt;
		&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;l&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;){&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;l&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;l&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;||&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[];&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;l&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;push&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'gtm.start'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
		&lt;span class=&quot;n&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Date&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;getTime&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(),&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;event&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:'gtm.js'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;getElementsByTagName&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;
		&lt;span class=&quot;n&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;createElement&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dl&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;l!&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'dataLayer'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;?&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'&amp;amp;l='&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;l&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;''&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;async&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;kp&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;
		&lt;span class=&quot;s1&quot;&gt;'https://www.googletagmanager.com/gtm.js?id='&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dl&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;parentNode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;insertBefore&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
		&lt;span class=&quot;p&quot;&gt;})(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;window&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'script'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'dataLayer'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'asldhfasdfkaj(GTMid들어가는곳)'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
	&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;/script&amp;gt;
	&amp;lt;!-- End Google Tag Manager --&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;

&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;n&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dataLayer&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Array&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
	&lt;span class=&quot;n&quot;&gt;dataLayer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;push&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'ecommerce'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;s1&quot;&gt;'purchase'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;s1&quot;&gt;'actionField'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;s1&quot;&gt;'id'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'T12345'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;                         &lt;span class=&quot;sr&quot;&gt;//&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Transaction&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Required&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;purchases&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;and&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;refunds&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;
        &lt;span class=&quot;s1&quot;&gt;'affiliation'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'Online Store'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;s1&quot;&gt;'revenue'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'35.43'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;                     &lt;span class=&quot;sr&quot;&gt;//&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Total&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;transaction&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;incl&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;tax&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;and&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;shipping&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;s1&quot;&gt;'tax'&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:'4.90'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;s1&quot;&gt;'shipping'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'5.99'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;s1&quot;&gt;'coupon'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'SUMMER_SALE'&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
      &lt;span class=&quot;s1&quot;&gt;'products'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[{&lt;/span&gt;                            &lt;span class=&quot;sr&quot;&gt;//&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;List&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;of&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;productFieldObjects&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;
        &lt;span class=&quot;s1&quot;&gt;'name'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'Triblend Android T-Shirt'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;     &lt;span class=&quot;sr&quot;&gt;//&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Name&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;or&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;ID&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;is&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;required&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;
        &lt;span class=&quot;s1&quot;&gt;'id'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'12345'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;s1&quot;&gt;'price'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'15.25'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;s1&quot;&gt;'brand'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'Google'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;s1&quot;&gt;'category'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'Apparel'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;s1&quot;&gt;'variant'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'Gray'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;s1&quot;&gt;'quantity'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;s1&quot;&gt;'coupon'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;''&lt;/span&gt;                            &lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;/ Optional fields may be omitted or set to empty string.
       },
       {
        'name': 'Donut Friday Scented T-Shirt',
        'id': '67890',
        'price': '33.75',
        'brand': 'Google',
        'category': 'Apparel',
        'variant': 'Black',
        'quantity': 1
       }]
    }
  }});

		(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
		new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
		j=d.createElement(s),dl=l!='dataLayer'?'&amp;amp;l='+l:'';j.async=true;j.src=
		'https:/&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;www&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;googletagmanager&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;com&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;gtm&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;js?&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'+i+dl;f.parentNode.insertBefore(j,f);
		})(window,document,'&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;','&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dataLayer&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;','&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;asldhfasdfkaj&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;GTM&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;들어가는곳&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;/script&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;이런 방식으로요.&lt;/p&gt;

&lt;p&gt;js에서 dataLayer라고 선언을 하게 되면 해당 dataLayer는 GTM에서 해당 데이터를 읽어서 어떤 트리거와 TAG를 통해 GA로 보낼 것인지 준비를 합니다.&lt;/p&gt;

&lt;p&gt;다음은 trigger setting입니다.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;hawoong12.github.io/images/trrigersetting.png&quot; alt=&quot;trigerset&quot; /&gt;&lt;/p&gt;

&lt;p&gt;줄 쳐놓은 저 곳에는 ‘구매완료URL에반드시포함되는referrer중 하나.’ 를 넣으시면 됩니다.&lt;/p&gt;

&lt;p&gt;여기까지 하셨다면 이제 js에서 데이터를 setting했으며 어떤 상황에서 그 데이터를 가져갈지 설정이 완료 되었어요.&lt;/p&gt;

&lt;p&gt;이제 trigger를 tag에 넣어서 GTM에서 GA로 보낼 수 있는 tag만 생성하면 끝입니다.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;hawoong12.github.io/images/tagsetting.png&quot; alt=&quot;tagset&quot; /&gt;&lt;/p&gt;

&lt;p&gt;태그 setting까지 완료 되었습니다.&lt;/p&gt;

&lt;p&gt;해당 사이트에 적용되었는지 확인하시려면 미리보기 버튼을 누르시고&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;hawoong12.github.io/images/ecommerce_dom.png&quot; alt=&quot;domset&quot; /&gt;&lt;/p&gt;

&lt;p&gt;gtm.dom tag가 실행되었는지,&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;hawoong12.github.io/images/ecommerce_dataLayer.png&quot; alt=&quot;datalayerset&quot; /&gt;&lt;/p&gt;

&lt;p&gt;해당 tag에 dataLayer가 정확히 setting되었는지 확인하시면 끝입니다.&lt;/p&gt;
</description>
        <pubDate>Fri, 17 Nov 2017 17:16:00 +0900</pubDate>
        <link>http://nsshopping.github.io/2017/11/17/GTM_GA_ECOMMERCE_LINK/</link>
        <guid isPermaLink="true">http://nsshopping.github.io/2017/11/17/GTM_GA_ECOMMERCE_LINK/</guid>
        
        
      </item>
    
      <item>
        <title>new post</title>
        <description>&lt;p&gt;## new post&lt;/p&gt;

&lt;p&gt;새글&lt;/p&gt;
</description>
        <pubDate>Fri, 17 Nov 2017 13:52:00 +0900</pubDate>
        <link>http://nsshopping.github.io/2017/11/17/new-post/</link>
        <guid isPermaLink="true">http://nsshopping.github.io/2017/11/17/new-post/</guid>
        
        <category>github</category>
        
        
        <category>github</category>
        
      </item>
    
      <item>
        <title>Soomin Post</title>
        <description>&lt;p&gt;soomin
test&lt;/p&gt;
</description>
        <pubDate>Fri, 17 Nov 2017 00:00:00 +0900</pubDate>
        <link>http://nsshopping.github.io/2017/11/17/soomin-post/</link>
        <guid isPermaLink="true">http://nsshopping.github.io/2017/11/17/soomin-post/</guid>
        
        
      </item>
    
      <item>
        <title>Git 개념잡기</title>
        <description>&lt;h2 id=&quot;git-개념&quot;&gt;GIT 개념&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;소스 코드 관리를 위한 분산 버전관리 시스템&lt;/li&gt;
  &lt;li&gt;CVS, Subversion 과 같은 영역을 담당하지만 2017년 현재는 GIT 이 독주 상태&lt;/li&gt;
  &lt;li&gt;버전관리 영역
    &lt;ul&gt;
      &lt;li&gt;로컬 PC : Working Dir =&amp;gt; Index (Stage) =&amp;gt; HEAD&lt;/li&gt;
      &lt;li&gt;GITHUB : Repository&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;기본개념도
    &lt;ul&gt;
      &lt;li&gt;&lt;img src=&quot;/files/contents_imgs/git_guide.png&quot; alt=&quot;git개념도&quot; /&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;fetch vs pull
    &lt;ul&gt;
      &lt;li&gt;fetch : 원격 저장소의 소스를 로컬 저장소로 가져온다&lt;/li&gt;
      &lt;li&gt;pull : fetch 후에 Merge 작업까지 수행한다&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;다른사람 Repository 내용으로 내 Repository 를 다시 맞추려면
    &lt;ul&gt;
      &lt;li&gt;다른사람 Repository 를 Pull 로 가져와서
        &lt;ul&gt;
          &lt;li&gt;git pull upstream master&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
      &lt;li&gt;내 Repository 로 push 한다
        &lt;ul&gt;
          &lt;li&gt;git push origin master&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;참조사이트&quot;&gt;참조사이트&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://marklodato.github.io/visual-git-guide/index-ko.html&quot;&gt;A Visual Git Reference&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://fronteer.kr/bbs/view/188&quot;&gt;github fork 후 원본과 sync 맞추기&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://rogerdudler.github.io/git-guide/index.ko.html&quot;&gt;git간편안내서&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://git-scm.com/book/ko/v1/Git-%EB%B8%8C%EB%9E%9C%EC%B9%98-%EB%B8%8C%EB%9E%9C%EC%B9%98%EC%99%80-Merge%EC%9D%98-%EA%B8%B0%EC%B4%88&quot;&gt;Git 브랜치 - 브랜치와 Merge의 기초&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://git-scm.com/book/ko/v1/%EC%8B%9C%EC%9E%91%ED%95%98%EA%B8%B0-Git-%EA%B8%B0%EC%B4%88&quot;&gt;Git기초&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Mon, 06 Nov 2017 13:52:00 +0900</pubDate>
        <link>http://nsshopping.github.io/2017/11/06/git-guide/</link>
        <guid isPermaLink="true">http://nsshopping.github.io/2017/11/06/git-guide/</guid>
        
        <category>github</category>
        
        
        <category>github</category>
        
      </item>
    
  </channel>
</rss>
