leptos/examples/counter-isomorphic
2022-12-12 09:26:13 -05:00
..
src Update counter-isomorphicexample 2022-12-12 09:25:47 -05:00
.gitignore Add .gitignore 2022-12-12 09:25:57 -05:00
Cargo.toml Update counter-isomorphic 2022-12-12 09:26:13 -05:00
index.html counter-isomorphic mostly works now 2022-11-14 14:52:05 -08:00
LICENSE counter-isomorphic mostly works now 2022-11-14 14:52:05 -08:00
README.md Clean up docs on counter-isomorphic 2022-11-18 11:48:08 -05:00

Leptos Counter Isomorphic Example

This example demonstrates how to use a function isomorphically, to run a server side function from the browser and receive a result.

Server Side Rendering With Hydration

To run it as a server side app with hydration, first you should run

wasm-pack build --target=web --no-default-features --features=hydrate

to generate the Webassembly to provide hydration features for the server. Then run the server with cargo run to serve the server side rendered HTML and the WASM bundle for hydration.

cargo run --no-default-features --features=ssr

Note that if your hydration code changes, you will have to rerun the wasm-pack command above This should be temporary, and vastly improve once cargo-leptos becomes ready for prime time!