<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>react | SDT 攻城獅區</title>
	<atom:link href="https://sdt.hameba.tw/tag/react/feed/" rel="self" type="application/rss+xml" />
	<link>https://sdt.hameba.tw</link>
	<description>由Steven, Der, Ted 三位高級打字員所組成，是三位工程師(攻城獅)所維護的技術分享平台，或許偶爾會分享一些日常，有任何問題或是錯誤的部分，歡迎留言告訴我們！</description>
	<lastBuildDate>Wed, 16 Dec 2020 10:09:28 +0800</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.3</generator>

<image>
	<url>https://sdt.hameba.tw/wp-content/uploads/2020/02/hameba_favicon-150x150.png</url>
	<title>react | SDT 攻城獅區</title>
	<link>https://sdt.hameba.tw</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Steven 網頁工程師心得分享</title>
		<link>https://sdt.hameba.tw/645/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=steven-%25e7%25b6%25b2%25e9%25a0%2581%25e5%25b7%25a5%25e7%25a8%258b%25e5%25b8%25ab%25e5%25bf%2583%25e5%25be%2597%25e5%2588%2586%25e4%25ba%25ab</link>
				<comments>https://sdt.hameba.tw/645/#respond</comments>
				<pubDate>Wed, 16 Dec 2020 10:09:28 +0000</pubDate>
		<dc:creator><![CDATA[Hsu Steven]]></dc:creator>
				<category><![CDATA[Other]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Angular]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[DB2]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[MariaDB]]></category>
		<category><![CDATA[MongoDB]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[react]]></category>
		<category><![CDATA[RedisDB]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Vue]]></category>

		<guid isPermaLink="false">https://sdt.hameba.tw/?p=645</guid>
				<description><![CDATA[<p>網頁工程師 網頁可以區分為前端及後端還有資料庫各個工程師 (其學習不是要把所有語言指令背下來，是好比今天有個功 &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/645/" class="more-link">閱讀全文<span class="screen-reader-text">〈Steven 網頁工程師心得分享〉</span></a></p>
The post <a href="https://sdt.hameba.tw/645/">Steven 網頁工程師心得分享</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>網頁工程師<br />
網頁可以區分為前端及後端還有資料庫各個工程師<br />
(其學習不是要把所有語言指令背下來，是好比今天有個功能需要完成，你”大概”知道在google搜尋什麼相關指令或是方法，解決問題就好)</p>
<p><span id="more-645"></span></p>
<p>前端有兩種<br />
1. 單純的網頁設計師，大約就是使用illustrator 跟 photoshop 設計網頁樣式<br />
2. 需要會程式邏輯的網頁設計工程師，類似當一般使用者按下按鈕促發一些功能或設計一些資料樣式的處理，跟後端溝通，需要會的語言-&gt;新手建議 HTML5, CSS3, jquery, js , 中高水準學習為Angular, React, Vue</p>
<p>後端語言為以下多種類型<br />
1. C# 微軟派系，為C#工程師，程式部署在iis上面，通常運行Microsoft SQL Server<br />
2. php 開源派系，為php工程師，程式部署在apache or tomcat上面，通常運行在Linux環境上面，中大型企業使用Redhat , 小型公司運行在Ubuntu<br />
3. java Oracle 派系 為java工程師，程式部署在tomcat or jBoss上面，通常運行在Linux環境上面，中大型企業使用Redhat , 小型公司運行在Ubuntu<br />
4. Node.js 開源派系，為node.js工程師，程式部署在pm2上面，通常運行在Linux環境上面，通常運行在Linux環境上面，屬Ubuntu市佔率為多數。<br />
5. python 開源派系 為python工程師，程式部署在系統啟動時的指令上面，通常運行在Linux環境上面，通常運行在Linux環境上面。<br />
6. Ruby on Rails 沒玩過，不清楚了 &gt;.&lt;</p>
<p>資料庫工程師<br />
1. noSQL =&gt; MongoDB, RedisDB (新型大數據以轉型使用MongoDB)<br />
2. SQL =&gt; SQL Server, MySQL, MariaDB, DB2 (SQL為目前市場大多數應用派系)</p>
<p>以上內容參考參考，很多keyword，可以先嘗試了解 前端工程師, 後端工程師, 資料庫工程師，這三種類型，選擇想前往的道路，</p>
<p>以下個人經驗<br />
前端 =&gt; 看得到畫面，可以第一接觸到使用者的體驗，成就感較高，也會被外面長官器重<br />
後端 =&gt; 第一次處理的邏輯，會不熟悉，沒感覺自己在做什麼，目標空洞，但有一兩次經驗後，後面得心印手，大概就只有這樣的把戲了！<br />
資料庫端 =&gt; 除非進到 FB, google, yahoo, 等非常前面科技的龍頭水準，才會有SQL優化條件，不然普遍把SQL 摸熟，不外乎CRUD的指令 CREATE, SELECT, UPDATE, DELETE, 比對條件 WHERE，然後就是養老了！！</p>
<p>以上是目前本人所看到產業大方向的情況，小弟一些愚昧的見解，沒有要跟任何派系的高手爭論。</p>The post <a href="https://sdt.hameba.tw/645/">Steven 網頁工程師心得分享</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/645/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>React webpack v3 升級 v4 錯誤訊息</title>
		<link>https://sdt.hameba.tw/495/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=react-webpack-v3-%25e5%258d%2587%25e7%25b4%259a-v4</link>
				<comments>https://sdt.hameba.tw/495/#respond</comments>
				<pubDate>Sun, 26 Jan 2020 16:20:51 +0000</pubDate>
		<dc:creator><![CDATA[Hsu Steven]]></dc:creator>
				<category><![CDATA[Other]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[react]]></category>
		<category><![CDATA[v3]]></category>
		<category><![CDATA[v4]]></category>
		<category><![CDATA[WebPack]]></category>

		<guid isPermaLink="false">https://sdt.hameba.tw/?p=495</guid>
				<description><![CDATA[<p>今天嘗試將就專案的webpack從v3升到v4，結果webpack-dev-middleware，一開啟一直跳 &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/495/" class="more-link">閱讀全文<span class="screen-reader-text">〈React webpack v3 升級 v4 錯誤訊息〉</span></a></p>
The post <a href="https://sdt.hameba.tw/495/">React webpack v3 升級 v4 錯誤訊息</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>今天嘗試將就專案的webpack從v3升到v4，結果webpack-dev-middleware，一開啟一直跳出此錯誤訊息：</p>
<p><span id="more-495"></span></p>
<p>You are currently using minified code outside of NODE_ENV === &#8216;production&#8217;. This means that you are running a slower development build of Redux. You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify or DefinePlugin for webpack (http://stackoverflow.com/questions/30030031) to ensure you have the correct code for your production build.</p>
<p>找了很多文章，都是說在webpack.config.js加上此句，</p><pre class="crayon-plain-tag">new webpack.DefinePlugin({
            'process.env': {
                NODE_ENV: JSON.stringify('development')
            }
        })</pre><p>或是將react-router從v3升級v4，但我原本就使用4.0.0了，但還是嘗試升級看看，</p>
<p>反而我從4.0.0升到4.0.5又出現其他錯誤訊息，只好將回4.0.0版本，</p>
<p>不管怎麼在設定檔案上做NODE_ENV的參數，都會報錯，</p>
<p>後來看到此command設定：</p><pre class="crayon-plain-tag">"dev": "webpack --mode development",

    "build": "webpack --mode production"</pre><p>好像可以解決我的問題，但我又發現我是使用webpack-dev-middleware，</p>
<p>並沒有地方可以設定command，幸好在原本的webpack.config.js可以加上此參數</p>
<p><span style="color: #ff0000"> mode:&#8221;development&#8221;</span></p><pre class="crayon-plain-tag">module.exports = {
    mode:"development",
    //入口文件
    entry:{
        'webpack-hot-middleware/client',
        path.resolve(__dirname, 'react')
    },
...
...</pre><p>設定完後，重新啟動start:dev，就沒有在跑出此錯誤訊息了！</p>
<p>mode此參數為v4所新增的。</p>
<p>&nbsp;</p>
<p>Reference</p>
<p><a href="https://blog.csdn.net/jiang7701037/article/details/80682662" target="_blank" rel="noopener noreferrer">https://blog.csdn.net/jiang7701037/article/details/80682662</a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>The post <a href="https://sdt.hameba.tw/495/">React webpack v3 升級 v4 錯誤訊息</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/495/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Gatsby (React) 移除meta顯示名稱及版本</title>
		<link>https://sdt.hameba.tw/492/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=gatsby-react-%25e7%25a7%25bb%25e9%2599%25a4meta%25e9%25a1%25af%25e7%25a4%25ba%25e5%2590%258d%25e7%25a8%25b1%25e5%258f%258a%25e7%2589%2588%25e6%259c%25ac</link>
				<comments>https://sdt.hameba.tw/492/#respond</comments>
				<pubDate>Sun, 26 Jan 2020 02:02:37 +0000</pubDate>
		<dc:creator><![CDATA[Hsu Steven]]></dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Gatsby]]></category>
		<category><![CDATA[meta]]></category>
		<category><![CDATA[react]]></category>

		<guid isPermaLink="false">https://sdt.hameba.tw/?p=492</guid>
				<description><![CDATA[<p>今天早上看到之前所做的 縮網址工具，用偵測工具發現顯示版本， 網站在head裡顯示一些開發工具的框架及版本其實 &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/492/" class="more-link">閱讀全文<span class="screen-reader-text">〈Gatsby (React) 移除meta顯示名稱及版本〉</span></a></p>
The post <a href="https://sdt.hameba.tw/492/">Gatsby (React) 移除meta顯示名稱及版本</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>今天早上看到之前所做的 <a href="https://url.hameba.tw" target="_blank" rel="noopener noreferrer">縮網址工具</a>，用偵測工具發現顯示版本，</p>
<p>網站在head裡顯示一些開發工具的框架及版本其實都是有安全問題的疑慮，</p>
<p><span id="more-492"></span></p>
<p><img class="alignnone size-large wp-image-493" src="https://sdt.hameba.tw/wp-content/uploads/2020/01/截圖-2020-01-26-上午9.51.02-1024x339.png" alt="gatsby show version" width="840" height="278" srcset="https://sdt.hameba.tw/wp-content/uploads/2020/01/截圖-2020-01-26-上午9.51.02-1024x339.png?v=1580003702 1024w, https://sdt.hameba.tw/wp-content/uploads/2020/01/截圖-2020-01-26-上午9.51.02-300x99.png?v=1580003702 300w, https://sdt.hameba.tw/wp-content/uploads/2020/01/截圖-2020-01-26-上午9.51.02-768x255.png?v=1580003702 768w, https://sdt.hameba.tw/wp-content/uploads/2020/01/截圖-2020-01-26-上午9.51.02-1536x509.png?v=1580003702 1536w, https://sdt.hameba.tw/wp-content/uploads/2020/01/截圖-2020-01-26-上午9.51.02-1200x398.png?v=1580003702 1200w, https://sdt.hameba.tw/wp-content/uploads/2020/01/截圖-2020-01-26-上午9.51.02.png?v=1580003702 1822w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /></p>
<p>Gatsby build出來的default文件在head可以找到以下的詞，</p><pre class="crayon-plain-tag">&lt;meta name="generator" content="Gatsby 2.18.17" /&gt;</pre><p>這樣一來有心人士就可以得知此版，依照此版漏洞做攻擊，</p>
<p>幸好到官網查詢一下，不難解決。</p><pre class="crayon-plain-tag"># 安裝gatsby套件
$ npm i -S gatsby-plugin-remove-generator</pre><p>找gatsby-config.js 做plugin設定</p><pre class="crayon-plain-tag">// default
module.exports = {
  ...
  plugins: [
    'gatsby-plugin-remove-generator',
  ]
};


// options
module.exports = {
  ...
  plugins: [
    {
      resolve: 'gatsby-plugin-remove-generator',
      options: {
        // Only remove the Gatsby version number instead of the whole node
        removeVersionOnly: true,
        // Customise the generator string altogether.
        // Note: This has the highest precedence of the available options.
        content: 'Custom string'
      },
  ]
};</pre><p>也可以使用option方式，自定義content，混淆有心人士。</p>
<p>&nbsp;</p>
<p>Reference</p>
<p><a href="https://www.gatsbyjs.org/packages/gatsby-plugin-remove-generator/" target="_blank" rel="noopener noreferrer">https://www.gatsbyjs.org/packages/gatsby-plugin-remove-generator/</a></p>The post <a href="https://sdt.hameba.tw/492/">Gatsby (React) 移除meta顯示名稱及版本</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/492/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>React v15 升級 v16 遇到 Uncaught TypeError</title>
		<link>https://sdt.hameba.tw/480/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=react-v15-%25e5%258d%2587%25e7%25b4%259a-v16-%25e9%2581%2587%25e5%2588%25b0-uncaught-typeerror</link>
				<comments>https://sdt.hameba.tw/480/#respond</comments>
				<pubDate>Sat, 25 Jan 2020 09:35:20 +0000</pubDate>
		<dc:creator><![CDATA[Hsu Steven]]></dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[prop-types]]></category>
		<category><![CDATA[react]]></category>
		<category><![CDATA[react-router]]></category>
		<category><![CDATA[v15]]></category>
		<category><![CDATA[v16]]></category>

		<guid isPermaLink="false">https://sdt.hameba.tw/?p=480</guid>
				<description><![CDATA[<p>React v15 升到v16，本作者遇到的問題有二 react v16 版本中，已經把PropTypes给移 &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/480/" class="more-link">閱讀全文<span class="screen-reader-text">〈React v15 升級 v16 遇到 Uncaught TypeError〉</span></a></p>
The post <a href="https://sdt.hameba.tw/480/">React v15 升級 v16 遇到 Uncaught TypeError</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>React v15 升到v16，本作者遇到的問題有二</p>
<p>react v16 版本中，已經把PropTypes给移出React，需改為以下方式，</p>
<p><span id="more-480"></span></p><pre class="crayon-plain-tag">// v15版本
import React, { Component, PropTypes } from 'react';

// v16版本
import PropTypes from 'prop-types';</pre><p>另一問題為Uncaught TypeError: Cannot read property ‘func’ of undefined，</p>
<p>作者發生此問題是因為react-router，</p>
<p>可以嘗試將react-router升到 3.2.0版本，</p>
<p>請勿一次就升到最高react router v5版本，</p>
<p>會因相關性抱錯更多，除非舊專案所用到的react套件均已更新，</p>
<p>否則不建議將每個node_module均升級到最高。</p>
<p>&nbsp;</p>
<p>Reference</p>
<p><a href="http://react-china.org/t/react-16/15384" target="_blank" rel="noopener noreferrer">http://react-china.org/t/react-16/15384</a></p>
<p><a href="http://react.html.cn/docs/typechecking-with-proptypes.html" target="_blank" rel="noopener noreferrer">http://react.html.cn/docs/typechecking-with-proptypes.html</a></p>The post <a href="https://sdt.hameba.tw/480/">React v15 升級 v16 遇到 Uncaught TypeError</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/480/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Gatsbyjs 新增內容於 head</title>
		<link>https://sdt.hameba.tw/381/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=gatsbyjs-%25e6%2596%25b0%25e5%25a2%259e%25e5%2585%25a7%25e5%25ae%25b9%25e6%2596%25bc-head</link>
				<comments>https://sdt.hameba.tw/381/#respond</comments>
				<pubDate>Fri, 27 Dec 2019 06:14:36 +0000</pubDate>
		<dc:creator><![CDATA[Hsu Steven]]></dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[gatsbyjs]]></category>
		<category><![CDATA[Google Adsense]]></category>
		<category><![CDATA[head]]></category>
		<category><![CDATA[react]]></category>

		<guid isPermaLink="false">https://sdt.hameba.tw/?p=381</guid>
				<description><![CDATA[<p>用gatsbyjs可以快速製作出react static網頁， 但是要將google adsense 加入時發 &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/381/" class="more-link">閱讀全文<span class="screen-reader-text">〈Gatsbyjs 新增內容於 head〉</span></a></p>
The post <a href="https://sdt.hameba.tw/381/">Gatsbyjs 新增內容於 head</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>用gatsbyjs可以快速製作出react static網頁，</p>
<p>但是要將google adsense 加入時發現，default設定沒有放head的方式，</p>
<p><span id="more-381"></span></p>
<p>所以官方也提供類似的方法。</p><pre class="crayon-plain-tag"># 進入專案資料夾下，執行複製指令
$ cp .cache/default-html.js src/html.js</pre><p></p><pre class="crayon-plain-tag">$ nano /src/html.js

# 內容如下
import React from "react"
import PropTypes from "prop-types"

export default function HTML(props) {
  return (
    &lt;html {...props.htmlAttributes}&gt;
      &lt;head&gt;
        &lt;meta charSet="utf-8" /&gt;
        &lt;meta httpEquiv="x-ua-compatible" content="ie=edge" /&gt;
        &lt;meta
          name="viewport"
          content="width=device-width, initial-scale=1, shrink-to-fit=no"
        /&gt;
        {props.headComponents}
      &lt;/head&gt;
      &lt;body {...props.bodyAttributes}&gt;
        {props.preBodyComponents}
        &lt;div
          key={`body`}
          id="___gatsby"
          dangerouslySetInnerHTML={{ __html: props.body }}
        /&gt;
        {props.postBodyComponents}
      &lt;/body&gt;
    &lt;/html&gt;
  )
}

HTML.propTypes = {
  htmlAttributes: PropTypes.object,
  headComponents: PropTypes.array,
  bodyAttributes: PropTypes.object,
  preBodyComponents: PropTypes.array,
  body: PropTypes.string,
  postBodyComponents: PropTypes.array,
}</pre><p>將想放入的GA, Google Adsense都可以放入Head裡面，</p>
<p>下次build product就可以看見Head有自定義的內容。</p>
<p>&nbsp;</p>
<p>Reference</p>
<p><a href="https://www.gatsbyjs.org/docs/custom-html/">https://www.gatsbyjs.org/docs/custom-html/</a></p>
<div id="gtx-trans">
<div class="gtx-trans-icon"></div>
</div>The post <a href="https://sdt.hameba.tw/381/">Gatsbyjs 新增內容於 head</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/381/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
	</channel>
</rss>
