How to handle reactivity in this example? - SolidJS