Hi I'm new to React and Hooks like useState. I'm having a hard time grasping the concept and how to use it. So I don't want to make more complex pieces and files than I have too.
I've run into a problem switching a React.component from a function to a class, Popover.
I've forked off a CodeSandbox to try to show what I'd like to switch too. But, I just can't understand the documentation well enough to make it happen.
What needs to happen to have a React.Class.Component use React-States?
<Button aria-describedby={id} variant="contained" onClick={handleClick}>
Open Popover
</Button>
<Popover
id={id}
open={open}
anchorEl={anchorEl}
onClose={handleClose}
anchorOrigin={{
vertical: 'bottom',
horizontal: 'left',
}}
>
<Typography sx={{ p: 2 }}>The content of the Popover.</Typography>
</Popover>