Pass refs to parent component in react?

Hey guys building Simon game here.

Just curious is there a way to pass refs around and pass them to parent container and set them in the state when component loads?

There is another way I can do what I want but I think using refs will be the easiest.


I created a quick example:

I don’t know if this would be considered “good React”, but it works.

1 Like

Hey thanks for this! This is pretty clever. :clap: