Pass Method Reference with parameters between Components

Continue with Passing Method reference between components article.

There are two ways:

  • Bind method
  • Arrow function

I have demonstrated both the approaches in App.js file. I am using bind method with button click and arrow function with paragraph click. But this combination is not necessary. You can do vice-versa as well.

We do not need to modify Person.js Component.

Modify App.js as per following code

Output before the click

Output after the click

bind(this, listOfArguments): list of arguments to be passed in the function.
Power Platform Academy

Start or Upgrade your Career with Power Platform

Learn with Akanksha

Python | Azure | AI/ML | OpenAI | MLOps

Design a site like this with WordPress.com
Get started