How can I include React useState in a custom gutenberg block plugin?

Okay, just lucked upon an answer.
Added

const {
    element: {
        useState,
    },
} = wp;

at the top of the file, it seemingly works, though I still have no idea what is going on.

tech