I am trying to add a button to my property pane that will pop up a modal where the user will be able to enter in an image to be displayed on my banner webpart which is just an image carousel.
I currently have a PropertyPaneButton. I would like to set the value of the onClick
key to a function as it's value that can setState within my webpart.tsx file allowing me to rerender the DOM. I have a stateful banner.tsx
file that is holding my banner images for the carousel in an array.
My idea is that once the user clicks add image
from the modal I'll be able to grab what's been entered in the text field, create a new object, and setState to have the DOM rerender with the new picture added to the carousel.
The issue seems to be that I am unable to link my webpart.ts file - where my property pane and add image button is, to my webpart.tsx
file - where my state holding the images is.
Admittedly, I am new sharepoint framework and am having difficulties navigating the documentation for a possible solution.