Dec 22 2020 06:18 PM
I have been unable to pass data from a react component back to the webpart ts using a function passed into props. I created the simplest example of this and continue to get the following error:
TypeError: Cannot read property 'props' of undefined
Here is my webpart files
ISync1Props.ts
Dec 22 2020 07:34 PM
Solution
Ok solved it by looking at this article:
https://www.voitanos.io/blog/deal-with-undefined-this-react-event-handler-performant-way/
added a bind statement in the constructor of the react component so that the passData function has proper reference to "this".
Dec 22 2020 07:34 PM
Solution
Ok solved it by looking at this article:
https://www.voitanos.io/blog/deal-with-undefined-this-react-event-handler-performant-way/
added a bind statement in the constructor of the react component so that the passData function has proper reference to "this".