Is it possible to render a react component in a rails partial through an AJAX call? Basically for performance reasons, I have to do some condition checks in order to render and initialize a react component in rails view. I cannot require the react JS upfront as well. I am thinking about rendering a partial through AJAX call and replacing the html in the view from jQuery. I am using react-rails
for this purpose.
I'm not sure if this is the best way to do it. Other alternatives would be helpful too.