preact-render-to-string
preact-render-to-string copied to clipboard
:page_facing_up: Universal rendering for Preact: render JSX and Preact components to HTML.
This builds on the parts of #135 that did hold some promise - a dedicated codepath for SSR that excludes configurability, and some caching. I think I'm seeing performance gains...
Update: boo, I botched the benchmark and this is actually slower than master. ~I've been sitting on this one for a little bit, and finally got the time to hack...
This should resolve https://github.com/developit/preact-render-to-string/issues/65. It includes code from https://github.com/developit/preact-render-to-string/pull/66. It is kept as a separate PR deliberately because `preact` doesn't currently have incoming support for `static getDerivedStateFromError(error)` https://github.com/developit/preact/pull/819 Documentation here:...
This does not include support for the `info` argument because `preact`'s support for `componentDidCatch()` does not pass this argument (https://github.com/developit/preact/pull/819#issue-136629967) Also includes 3 new tests.
Mixed rendering is a mode that works like shallow rendering, but where you can specify a list of components you want to render even tho they are deeply nested. We...
Right now using preact-render-to-string directly you end up with double encoding in the snapshot output see this twitter thread -- https://twitter.com/stillconor/status/805567906310451200 -- for more details. cc @developit , I'd be...
https://github.com/developit/preact/pull/819 adds support for `componentDidCatch(error)` (note that it currently does not include the `info` argument) we will need to support `componentDidCatch(error)` to achieve parity with `preact` once that PR is...
In addition to supporting `componentDidCatch` (see https://github.com/developit/preact-render-to-string/issues/64) `preact-render-to-string` should support `static getDerivedStateFromError(error)` Documentation here: https://reactjs.org/docs/react-component.html#static-getderivedstatefromerror
Hi It would be good to have an interface like this: ```js render( ).then(({html, context, state}) => { /* all done, serve to client now */ } ``` So the...