@twind/wmr
v1.0.10
Published
Twind integration for WMR
Downloads
4
Readme
@twind/wmr
Twind integration for WMR utilizing @twind/preact.
Installation
npm install @twind/wmr
Usage
-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 }