Git Product home page Git Product logo

Comments (4)

biaochenxuying avatar biaochenxuying commented on May 21, 2024

请教一下楼主,src/components/articles/articles.js文件第125行,如下图所示:

image

每次下拉触发ajax请求,取回了一定数量的的数据,每取回一次都要和已经取回的数据进行一次合并操作,当一直往下拉的时候,数据会越来越多,数组越来越大,会不会性能很差呢?

性能会变差的,小数据能这么做,当然有很大数据时最好就不要了,用扩展运算符 ... 会好点。

from blog-react.

1ess avatar 1ess commented on May 21, 2024

这里的 setState 用 prevState 好点吧

from blog-react.

1ess avatar 1ess commented on May 21, 2024

6ffb120239dc3d4c4f78f2998a9cafc
我没用官方 demo 的写法,这么写我感觉不错。code标签就不用你自己写样式了

from blog-react.

biaochenxuying avatar biaochenxuying commented on May 21, 2024

查了一下,是 prevState 好;marked 的用法好多的,好用就好。

from blog-react.

Related Issues (9)

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.