美文网首页
面试总结1

面试总结1

作者: camy | 来源:发表于2021-10-21 12:23 被阅读0次

    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 to useState. Accepts a reducer of type (state, action) => newState, and returns the current state paired with a dispatch 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.

    image.png

    React-redux official redux Ui binding library for react.

    4 AWS pipeline

    5 test 前后端

    6 RDS and non-relational database

    1. 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.
    1. 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

    相关文章

      网友评论

          本文标题:面试总结1

          本文链接:https://www.haomeiwen.com/subject/cjffaltx.html