step.rs 544 B

1234567891011121314151617181920212223242526
  1. use dioxus_core::prelude::*;
  2. fn main() -> Result<(), ()> {
  3. let p1 = Props { name: "bob".into() };
  4. let mut vdom = VirtualDom::new_with_props(Example, p1);
  5. vdom.update_props(|p: &mut Props| {});
  6. Ok(())
  7. }
  8. #[derive(Debug, PartialEq)]
  9. struct Props {
  10. name: String,
  11. }
  12. static Example: FC<Props> = |ctx, _props| {
  13. ctx.render(html! {
  14. <div>
  15. <h1> "hello world!" </h1>
  16. <h1> "hello world!" </h1>
  17. <h1> "hello world!" </h1>
  18. <h1> "hello world!" </h1>
  19. </div>
  20. })
  21. };