title: Use dynamic number of hooks in React
body: <p>Let's say I have a hook, useX() that returns some states and functions. I do an API request that returns some (dynamic amount of) strings (for example, &quot;a&quot; and &quot;b&quot;).</p>
  <p>I want to have a dictionary mapping these strings to instances of useX(), something like: x = {a: useX(), b: useX()}, so I can do actions like x.a.someFunction() or x.a.someState.</p>
  <p>I know React doesn't let you call hooks inside loops, so I wonder whether this is even possible at all. Please help!</p>