I am experimenting with separating a fetch call into its own component. I am not concerned with whether or not this is best practice, I'm trying it as a learning experience.
My separated fetch call is here. I've shown it two different ways and commented what the error is. One attempt gives me an "invalid hook call" warning, which I understand. The other attempt does not set state. My main focus is here - I can not figure out where to place the state hook. My state manager Jotai is set up correctly.
I am attempting to import this fetch call into this file.