Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React 相关 #21

Open
QC-L opened this issue Aug 8, 2018 · 0 comments
Open

React 相关 #21

QC-L opened this issue Aug 8, 2018 · 0 comments

Comments

@QC-L
Copy link
Owner

QC-L commented Aug 8, 2018

  • 在 backbone 里用 react 渲染
  • 在 angular 里用 react 渲染
  • 在 vue 里用 react 渲染
  • 在 xxx 里用 react 渲染
    然后再从 react 里拿出 dom,调用 dom api 或者 用 jQuery 插件, d3 套这个 dom

语言层面:

  • 用 coffee, es5, es6, jsx, ts, tsx 写

react 组件设计:

  • pure component
  • functional component
  • smart, dumb component
  • higher order component
  • hoc render hijacking
  • 会用 props.children React.children cloneElement
  • 提供 instance method
  • context

内部实现:

  • 懂 setState 是异步的
  • 懂 synthetic event
  • 懂 react-dom 分层和 react 没有关系
  • 懂 reconciler
  • 懂 fiber

测试:

  • 会写 jest
  • 会写 snapshot test

炫技:

  • 写一个顺滑的拖拽
  • 用一个 component 递归渲染
  • 写一个 react router

未来:

  • 知道 react 将来要增删哪些 api
  • 用 preact, inferno 替换 react

最最重要:

  • 懂 react 这个单词是什么意思
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant