I'm having a rendering issue with some of my components and stumped on how to tell the previous component that its state has updated.
For example:
file 1:
/ ** code ** /
const [var1, var2] = React.useState()
/ ** code ** /
return( ... <secondComponent x=var1 y=var2 /> ...)
file 2:
/ ** code ** /
// changes to variable x and y
/ ** code ** /
The changes go through, but they're not rendered onto the webpage until I react with something else already on the webpage or something that is attached to the component in file 1.
I want the changes to be instantaneous on the page without me having to touch anything on the page.
edit: I'm using only functional components