step.rs 542 B

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