Code Monkey home page Code Monkey logo

Comments (6)

Nikhil-Nandagopal avatar Nikhil-Nandagopal commented on July 2, 2024

@rennzhang what type of data are you looking to cache? You can use the storeValue function to save data in the local storage.

from appsmith.

rennzhang avatar rennzhang commented on July 2, 2024

Simply put, I hope that the page switch will not re-render the component. I tried some react-route caching solutions, but it didn't work

For example, page a has a table component. I enter some query conditions and search for data. Then I jump to page b and return to page a. I hope that page a will not be refreshed, that the data will not be retrieved, and that I will keep the query conditions I entered before.

from appsmith.

Nikhil-Nandagopal avatar Nikhil-Nandagopal commented on July 2, 2024

@rennzhang that is currently not possible

from appsmith.

rennzhang avatar rennzhang commented on July 2, 2024

@Nikhil-Nandagopal Thank you for your answer. I spent a few days understanding the component rendering mechanism of this project, which is indeed very complex. However, I am not familiar with React enough, so I would like to ask about the general reason

from appsmith.

Nikhil-Nandagopal avatar Nikhil-Nandagopal commented on July 2, 2024

The general reason is that each page is garbage collected after it's navigated away from to ensure that it doesn't consume memory. Appsmith is generally used for live dashboards where data changes and so it makes sense to fetch the data again.

from appsmith.

rennzhang avatar rennzhang commented on July 2, 2024

I fully understand that it makes sense to have him rerender. Too much caching will cause a lot of memory to consume, and maybe the data state of the component is incorrect... But I still want to ask, if I only make modifications to a few components, such as table and list components, so that it retains data when switching pages, or recovers data from cache, is there any feasible way?

I tried to store cached widgetStaticProps here. Judging from the print log, it will initially be applied to the component, but will eventually be overwritten by the original props.

from appsmith.

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.