Refactor Html.React with initialization flag into standalone method