title: Conditional Rendering and Const Setup of global variables-typescript
body: <p>I am working on a react typescript project and have a global utility that has a constructor and fills itself a database-but only after the user clicks a button. My problem is that the display modal to display the information is still rendering and so I get a type error cannot read undefined. How can I stop the component from running through getters into const vars and only run the const when I ask it to render?</p>