I am creating this react app in which I want to export a variable to another react functional component. I am also facing an issue since when a user clicks on a button, only then will the variable contain value or else it is undefined and exporting an undefined variable is not possible. So I was hoping that there is a way I can export the variable only when it contains a value. Thanks in advance to anyone who has helped!
PS: I am a Beginner :)