leptos/examples/parent_child
Joseph Cruz 8c5ab99fa7
build(examples): pull up compile tasks (#1417)
* build(examples): pull up compile tasks

* build(examples): set toolchain for compiles tasks

* build(examples): set toolchain for build and check

* build(examples): set toolchain of other examples
2023-07-24 11:35:34 -04: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 docs: typo (#1237) 2023-06-26 10:05:16 -04:00
Cargo.toml change: migrate to nightly and csr features rather than stable and default-features = false (#1227) 2023-06-26 21:12:14 -04: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): pull up compile tasks (#1417) 2023-07-24 11:35:34 -04:00
README.md Fix labels in parent_child README 2023-01-28 21:52:16 -05: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)

Client Side Rendering

To run it as a Client Side App, you can issue trunk serve --open in the root. This will build the entire app into one CSR bundle

If you don't have trunk installed, click here for install instructions.