Check out example codes for "render to string rails". It will help you in understanding the concepts better.

Code Example 1

render_to_string(options = nil, &block) protected
Renders according to the same rules as render, but returns the result in a string instead of sending it as the response body to the browser.

Learn ReactJs, React Native from akashmittal.com