meteor-fast-render
meteor-fast-render copied to clipboard
using sink.appendToBody breaks fastrender
reproduction:
FastRender.onPageLoad(async sink => {
sink.appendToBody('<p>test</p>');
})
will result in [object Object]<p>test</p> instead of <script type="text/inject-data">%7B%22fast-render-data....><p>test</p>
The problem is probably in inject-data
workaround:
import { InjectData } from 'meteor/staringatlights:inject-data';
InjectData.disableInjection = true;
FastRender.onPageLoad(async sink => {
...
const payload = `<script type="text/inject-data">${InjectData.encode(
sink.request.headers._injectPayload
)}</script>`;