React Label
<label for="male">Male</label> <input type="radio" name="gender" id="male" value="male"> <label> Name: <input type="text" name="name" /> </label> HTML...
Read more<label for="male">Male</label> <input type="radio" name="gender" id="male" value="male"> <label> Name: <input type="text" name="name" /> </label> HTML...
Read more常用指令: :wq save and exit :qa! exit Esc back to normal mode i insert 在pick那邊按ctrl + A 可以切換狀態(pick、squash…) 參考文章 How to Save a File in Vim / Vi and...
Read more
解釋Walking skeleton是什麼 這是烏的咪的一堂課,一邊聽課一邊做點筆記。 Complete guide to building an app with .Net Core and React 1-2教安裝.NET SDK Creating the .Net projects and r...
Read moreLexico.com Cambridge Dictionary English Dictionary, Translations & Thesaurus YourDictionary Vocabulary.com – Learn Words – English Diction...
Read moreWebStorm快捷鍵 Ctrl + B Go To Definition(Navigate to declaration) Alt + Enter Show intention actions Alt + Shift + F10 Run configurations Ctrl + W Extend...
Read more很多人會做什麼事,可是他自己很難表達出來他是怎麼做到的,這是波蘭尼弔詭(Polanyi’s Paradox) nugget ice 礦塊冰感覺很特別… 機器人的創作 書上提到的企業: FirstBuild Indiegogo 喜飛思分析 Civis Analytics 小松製作所 K...
Read more大多應用的場景: 記錄之前的值,不需要re-render 對DOM加上一個ref 對input做focus… 這裡有個實用的 usePrevious 可以直接拿來用,不過用在input的時候,發現用右鍵刪掉input的值,再新增的話,它就會記空字串,要注意一下。...
Read more騎單車通勤的人,身體健康,降低很多疾病上身的機率 兼職工作的人對工作的滿意度平均高於全職工作的人。 美國以前創業很難,會讓人想加入共和黨。 在美國很多有錢的亞洲人,教育程度也高。 在美國,經濟好的大多會投共和黨。 在有的國家,大麻合法化是個趨勢。...
Read moreAnatomy of a Unit Test Unit Testing Framework Microsoft.VisualStudio.TestTools.UnitTesting Namespace Unit test your code Unit testing C# with MSTest a...
Read moreeslint報錯解決方式: ESLint: Expected linebreaks to be ‘LF’ but found ‘CRLF’.(linebreak-style) 編輯器如果這邊是CRLF就會每一行都有紅波浪 開始研究怎麼解決 在打開專案的...
Read more
藍色的地方就是keyword cw再打Tab,就會變成Console.WriteLine() An object is an instance of a class. One class per file. 對 class 的名子按 Alt + Enter 可以給它抽出來變成一個檔案 對Projec...
Read more已經有原生的方法可以壓縮圖片惹,前端可以直接使用: <img src="image.png" loading="lazy" alt="…" width="200" height="200"> 另外,也可以把圖片轉成webp,是一個新的圖片格式,輕量快速 可以直接用軟體來轉: Webpconv 參考:...
Read more
超級簡單的,只要二個步驟! 1. 到 Google fonts 選一個font 按那個加,右邊會彈出教學 2. 選好之後,可以選要加入的方式 有三種方法: 1. 在html的head上加link 2. 在html的head上加style 3. 直接在css上import 在css上加的範例, fam...
Read more
這周在公司遇到Yves,他順便幫忙解惑了一下: 只要符合四大宣言,就是跑敏捷。 不過跑敏捷不等於跑scrum,跑scrum就要照它的flow走,沒有照著走的話,就是scrum, but… 敏捷不等於用新的技術,但敏捷代表持續學習(它的精神有)所以如果新的技術用了對軟體是有加分的話,就是可...
Read more在import css檔案的時候會有問題,這時候可以: 加一個styleMock.js檔案,把css都變成空物件 styleMock.js module.exports = {}; 加了之後在 jest.config.js 裡面對應這個檔案 module.exports = { setupFiles...
Read moreconst words = [{...}, {...},{...},{...},{...},{...}]; 這時候想要取出其中一個物件,要用什麼方法呢? 如果使用filter,可能會變這樣 [{...}, {...}] 回傳的還是陣列,要取它裡面的值,需要這樣 words[0].value ...
Read more因為JavaScript是non-blocking,例如去買電影票排隊,排到跟剪票的人說:「欸,我沒帶票,我老婆要過來了,可以等我嗎?」剪票的人說:「不行,你後面還有一排人欸,你先站邊邊,等老婆來了再排啦。」這就是JavaScript的運作方式。 If something needs to wait...
Read more看了這篇,大致重點如下: const fatLuna = { kg: 999, test: true }; const ano = { kg: 7, style: "flurry" }; 要console.log的時候, bad code: console.log(fatLuna); console...
Read more首先先開一個專案 npm init 開好專案之後,安裝webpack npm install webpack webpack-cli --save-dev npm install react react-dom npm i @babel/core babel-loader @babel/preset...
Read more如圖,可以快速裝好airbnb規範 輸入這個指令 npx eslint --init 安裝完之後,在webStorm的設定那邊開啟eslint 之後就會看到一堆可怕的紅線惹。然後再搭配prettier 再新增.prettierrc檔案 { "printWidth": 100, "singleQuot...
Read morebabel裡的plugins是晶片,有各種晶片可以提供各種的功能。然後就有懶人包:presets,可以想像成是晶片包(其實也可以比喻成各種菜組合成的便當) babel7可以建一個 babel.config.json 檔案來做設定 使用async/await會報錯: regeneratorRuntim...
Read more姆喵要在本機端看程式變怎麼樣,所以需要這個功能。 很簡單,首先先安裝 webpack-dev-server 再看怎麼辦。 npm install webpack webpack-cli webpack-dev-server --save-dev 喔對了還要安裝這個 npm i html-webpac...
Read more不想用腳手架 create-react-app 的時候,就需要研究一些有的沒的。 搜尋關鍵字: react webpack tutorial 參考文章: A mostly complete guide to webpack (2020) Tutorial: How to set up React, ...
Read more在寫react常用到import和export,這些就是ES Modules,目前已經被大部份的瀏覽器支援。就連Node.js 12版以上也支援了。 需要用到module的程式,在script上需要加上type=”module”註記 <script type="module"...
Read more要看render出來的結構長怎麼樣,可以用 screen . debug ( ) ; 覺得要query的element有可能不在的話,用queryBy,因為getBy如果找不到就會throw Error。 不應該去測試DOM的結構,DOM的結構應該當成黑箱子。 假設有個按鈕,用getByRole不要...
Read moreimport { useMemo } frmo ‘react’; 使用 useMemo 來幫進行大量運算的function做cache,如果要傳給它下一層的component的話,再用 useCallback 包起來。 useCallback 顧名思義就是一個callback...
Read more
首先先安裝 prettier npm i prettier -D 之後到Settings裡面找當前目錄下的node_modules裡的prettier 再勾選on save,就可以在save的時候自動幫忙format。(eslint不用裝也會) 選package.json,它會跳出這個提問,選Yes...
Read moreOctober 5-7, 2021 ElasticON Global 11/29 https://reinvent.awsevents.com/ https://www.outsystems.com/nextstep/2021/ 10/21 http://reactjsday%202021%20@1...
Read more一開始先選擇「Edit Configurations」 之後點擊加加+ 選擇 JavaScript Debug 如下輸入資料 設定完就可以在編輯器debug了。 記得是按蟲,不是按鍵頭 參考 這篇...
Read more因為React最近更新到17了,用webstorm在import的時候少了一些自動幫忙import的功能,要再安裝插件: 文章來源: https://stackoverflow.com/questions/46871567/webstorm-auto-completion-does-not-work...
Read more