1 React 生命周期
2 hooks(useState, useEffect,
- useContext,=> createContext, useContext()
- useMemo,
Returns a memoized value.
, useMemo runs during rendering. Don’t do anything there that you wouldn’t normally do while rendering. - useReducer,
An alternative touseState
. Accepts a reducer of type(state, action) => newState
, and returns the current state paired with adispatch
method. (If you’re familiar with Redux, you already know how this works.)
image.png
[Redux
] creates one global state container which is above your whole application and is called a store.
[useReducer
] creates an independent component co-located state container within your component.
- useRef, ref=input, createRef,ref.current.validate()
- useCallback
Returns a memoized callback.
useful when passing callbacks to optimized child components that rely on reference equality to prevent unnecessary renders (e.g. shouldComponentUpdate).
useCallback(fn, deps) is equivalent to useMemo(() => fn, deps).
2.1 Fuction component vs class component
3 redux及项目中的使用
React is a library used to build user interfaces.
Redux - state management library for javascript applications.
React-redux official redux Ui binding library for react.
4 AWS pipeline
5 test 前后端
6 RDS and non-relational database
- Data Strucutre
- NoSQL databases are designed to handle the more complex, unstructured data, (such as texts, social media posts, photos, videos, email).
- Relational databases were built during a time that data was mostly structured and clearly defined by their relationships.
- Scaling
- Relaltional databases require a single server to host the entire database,
3 Performance
关系型数据库:缺点: 读写性能比较差,尤其是海量数据的高效率读写;
7 JWT
- header
- payload, 由我们需要发送的数据内容构成
-
Singnature,签名由上面我们得到的header和payload的base64的字符串,通过.连接起来,然后使用HS256算法进行加密得到。
image.png - 缺点:由于jwt的payload是使用base64编码的,并没有加密,因此jwt中不能存储敏感数据。
https://chengandpeng.github.io/2016/04/15/jwtvscookie/
8 React function compoent vs Class compoent
网友评论