Closed zer0Id0l closed 6 years ago
@zer0Id0l I think the reason is more likely to be related that the render "context" you provide is passed through JSON.stringify as you can see here. The reason, is because that properties are "rendered" to a plain html page later, so it would'nt make sense to pass down functions anyway.
I was trying to pass a function as payload parameter during react router rendering, but seems like all function type fields in render payload object are stripped out. Any particular reason for that reason?
res.render(
${requestURI}${req.url}, { fn: fn, pageData: data })
My guess is that, we would usually render a page with static content hence only basic fields which are allowed to render initial state are allowed.