PricingBlog

Proper Way To Call APIs in Nested Components

  • fuelmeup-1252644374303477955

    AY EYE

    1 year ago

    I have a component that lives in another component.

    The child component needs to make an API call and then show the response in the child component.

    If I make the API call in the child component, will the response/result still show when i place that child component on the parent component?
  • lucasg-1252647706359365673

    Lucas G

    1 year ago

    Everything in a component is scoped to the component itself.
  • lucasg-1252648710673006683

    Lucas G

    1 year ago

    So you’d have to pass that data via attributes/events
  • fuelmeup-1252651216069066762

    AY EYE

    1 year ago

    makes total sense