PricingBlog

How do I transfer data in a variable (inside of a component) to another page

  • leerussel-1275694495165452331

    Lee Russel

    1 year ago

    I have a variable in a component that is an object with multiple arrays of data in it. These arrays get updated based on button clicks inside of the component.

    This is basically creating a temporary object that holds data that needs to be used on another page to display this data in cards.

    What should I be researching here? Events? Local Storage? URL Parameters? Any help would be appreciated!
  • max.kayr-1275703198681792543

    Max

    1 year ago

    Usually you don't want to pass objects from one page to another. A common approach is to pass an id to another page and this id is used to fetch data from a database. If you really want to do this, I think you need to use the local storage or session storage.
    this_tbh1