Twind integration for WMR utilizing @twind/preact.
npm install @twind/wmr
-import hydrate from 'preact-iso/hydrate';
+import withTwind from '@twind/wmr';
+const { hydrate, prerender } = withTwind((data) => <App {...data} />)
hydrate(<App />)
-export async function prerender(data) {
- // we use dynamic import to prevent this from being loaded in the browser:
- return (await import('preact-iso/prerender')).default(<App {...data} />);
-}
+export { prerender }
Shim-like usage but without the shim
-import hydrate from 'preact-iso/hydrate';
+import withTwind from '@twind/wmr';
+const { hydrate, prerender } = withTwind({
+ // Options for @twind/preact
+ props: {
+ className: true, // Shim like experience without the shim
+ },
+ /* other twind configuration options */
+}, (data) => <App {...data} />)
hydrate(<App />)
-export async function prerender(data) {
- // we use dynamic import to prevent this from being loaded in the browser:
- return (await import('preact-iso/prerender')).default(<App {...data} />);
-}
+export { prerender }