Giter Club home page Giter Club logo

Comments (5)

chenzesam avatar chenzesam commented on August 15, 2024

数据和 UI 分离的完美。
文章实战满分

from blog.

hkongm avatar hkongm commented on August 15, 2024

手动赞!

from blog.

rubbishquan avatar rubbishquan commented on August 15, 2024

请教一下,FriendListItem和useFriendStatusString都是使用了底层的useFriendStatusBoolean,为什么前者是无状态,后者是有状态?

from blog.

ascoders avatar ascoders commented on August 15, 2024

@rubbishquan 我理解的是,使用 Hooks 的 UI 组件都是无状态的(执行效果类似于依赖注入,就好比使用 react-redux connect 的组件还是无状态的一样),非 UI 组件都是有状态的(执行效果和普通函数类似)。

区别应该是 UI 组件调用 useXXX 会走特殊执行逻辑,模拟成高阶函数效果,而普通组件调用 useXXX 没有这个待遇,所以不一样。不过听 facebook 同学说这个 api 还在试水阶段,以后也许会改。

from blog.

zhangaz1 avatar zhangaz1 commented on August 15, 2024

留个痕迹

from blog.

Related Issues (20)

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.