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.

Thanks!

I created a quick example: https://codesandbox.io/s/xlpp5ozn3z

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: