This could be done by wrapping the custom component in a stateful component. (Suggestion by @uyouthe)
This could be done by wrapping the custom component in a stateful component. (Suggestion by @uyouthe)