Giter Club home page Giter Club logo

Comments (3)

Jokcy avatar Jokcy commented on July 24, 2024
  1. 使用observe的数据说明这个数据是mutable的,而对于React来说,更推荐的是使用inmutable的数据,因为React是根据props和state的变化来探测一个组件是否需要执行更新的,而对于一个mutable的数据,改变来他的内容,但是他本身没有变化,如果拿他作为props,则会导致组件可能被shouldComponentUpdate误认为不需要更新的。

  2. 确实,现在使用Provider在顶层使用context并不是一个很好的选择,因为context变化之后他的子树层级越多,他的性能消耗越大。所以react-redux也提出了想要一个觉解这个问题的方案,就看react官方会不会考虑来。目前来说,如果你不依赖redux,你自己实现store,是完全可以根据你自己的情况把context尽量放在低层级的,这样可以减少context的更新带来的性能影响。这里没有什么必须要,你完全可以根据自己的情况来实现。

from ama.

winixt avatar winixt commented on July 24, 2024

�多谢多谢,受教了🙏

from ama.

Jokcy avatar Jokcy commented on July 24, 2024

这是一个段落

这是一个引用

样式应该还不错,这样的这样的code

function x() {
  return a + b;
}

from ama.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.