leptos/examples/parent_child
Saber Haj Rabiee db1c15f4e4
fix: fix web-sys warnings in server_fn (#2828)
* fix: fix web-sys warnings in server_fn

* fix: update web-sys to 0.3.70

* fix: web-sys clipboard api in 0.3.70
2024-08-13 15:46:34 -07:00
..
public Add Favicons to all the examples and standardize on the public folder for public assets 2023-01-09 15:27:52 -08:00
src chore: cargo fmt 2024-08-01 19:41:56 -04:00
Cargo.toml fix: fix web-sys warnings in server_fn (#2828) 2024-08-13 15:46:34 -07:00
index.html Add Favicons to all the examples and standardize on the public folder for public assets 2023-01-09 15:27:52 -08:00
Makefile.toml build(examples): make it easier to run examples (#1697) 2023-09-12 10:46:16 -04:00
README.md docs: make it easy to see how to run each example in its README (#2085) 2023-11-28 11:47:56 -05:00
rust-toolchain.toml chore(ci): run all examples under stable and fix remaining linting issue (#2503) 2024-04-05 16:09:23 -04:00

Parent Child Example

This example highlights four different ways that child components can communicate with their parent:

  1. <ButtonA/>: passing a WriteSignal as one of the child component props, for the child component to write into and the parent to read
  2. <ButtonB/>: passing a closure as one of the child component props, for the child component to call
  3. <ButtonC/>: adding a simple event listener on the child component itself
  4. <ButtonD/>: providing a context that is used in the component (rather than prop drilling)

Getting Started

See the Examples README for setup and run instructions.

Quick Start

Run trunk serve --open to run this example.