The entryPoint argument in Ssr::new tells the engine where to find the rendering logic within your bundled JavaScript. It can be:
- An empty string (
""): Use this if your bundle is an IIFE (Immediately Invoked Function Expression) that returns the required object, or if the bundle is just a plain object. - A variable name: Use the name of the variable that holds the object containing your rendering functions (e.g.,
"SSR").
Examples of entryPoint mapping:
IIFE (entryPoint = "")
(() => ({ renderToStringFn: (props) => "<html></html>" }))()
Plain Object (entryPoint = "")
({renderToStringFn: (props) => "<html></html{}"})
IIFE Variable (entryPoint = "SSR")
var SSR = (() => ({renderToStringFn: (props) => "<html></html>"}))()
Variable (entryPoint = "SSR")
var SSR = {renderToStringFn: (props) => "<html></html>"};