Closed duro closed 9 years ago
I see the same thing.
It's definitely the script which injects the __marty
variable. A possible adhoc solutions would be to split the script out from the react html and leave it up to the user to inject it into their template.
Marty.renderToString({
type: Component,
context: context
}).then(function (render) {
res.render('index', { html: render.html, marty: render.marty });
});
I like @jarsbe's solution
Sorry for the delay getting to this. I've just released marty v0.9.17 which adds htmlBody
and htmlState
to the render result allowing you to do @jarsbe's solution. I've just released marty-express v0.4.0 which takes advantage of these new variables.
I am setting up a Marty isomorphic app, and so far I have everything rendering properly from the server. However when I open up the console in my browser, I have the following warning:
I think that what is causing this is the
<script>
tag that Marty injects at the end of the rendered HTML that is used for dehydration/rehaydration.Is there a way to avoid this?