score:1

i don't believe so, but you could put all of your states into on usestate hook. for example, i'd probably go with this:

const [allstates, setallstates] = react.usestate({
  state1: yourstate1,
  state2: yourstate2,
  ...
})

then you can iterate through your states with index reference or using object.keys(allstates).

i can't tell exactly what it is that you're attempting, but as a guess i think you might be better capturing everything in a usestate:

const [allstate, setallstate] = react.usestate([
   {
    title: 'titolo 1',
    description: 'description 1',
    ...any other state
  },
  {
    title: 'titolo 2',
    description: 'description 2',
    ...any other state
  },
])

Related Query

More Query from same tag