網頁都是預設port 80。所以不用加 : 80
例如輸入:
http://www.lunacute.io:80/api/ 會變成
http://www.lunacute.io/api/
Category: Uncategorized
英文詞彙使用範例搜尋
JavaScript改變CSS變數
參考這篇文章,很淺顯易懂,可以馬上上手:
Updating a CSS Variable with JavaScript
Handle clicks outside of React components
React工具書

TypeScript學習
因為到處的React教學幾乎都夾雜TypeScript,所以決定還是趕快來學一下,不然要看教學也看不懂🤣
以下列出一些覺得還不錯的教學文章。
microsoft/TypeScript-React-Starter
Getting started with React and TypeScript
Using React Functional Components with Hooks in TypeScript
教怎麼寫functional component,還有hooks
React with TypeScript: Best Practices
React with TypeScript: Components as Function Declarations vs. Function Expressions
React Children with TypeScript
React with Typescript
React TypeScript Cheatsheets | React TypeScript Cheatsheets
typescript-cheatsheets/react: Cheatsheets for experienced React developers getting started with TypeScript
TypeScript for React developers in 2020
電子書:
TypeScript Deep Dive
useEffect – compare object
https://twitter.com/dan_abramov/status/1104414469629898754
目前專案常見問題:stackoverflow
play JavaScript
[].concat({name: ‘lunaCute’});


react.js PropTypes
導入這樣導:
import PropTypes from 'prop-types'; // ES6
設定這樣設:
CuteLuna.propTypes = {
order: PropTypes.arrayOf(PropTypes.string),
};
各種類型:
// array of string
order: PropTypes.arrayOf(PropTypes.string),
MyComponent.propTypes = {
items: PropTypes.arrayOf(
PropTypes.shape({
code: PropTypes.string,
id: PropTypes.number,
})
),
};