mod.rs 371 B

123456789101112131415161718
  1. mod button;
  2. mod checkbox;
  3. mod input;
  4. mod number;
  5. mod password;
  6. mod slider;
  7. mod textbox;
  8. use dioxus_core::{ElementId, RenderReturn, Scope};
  9. pub use input::*;
  10. pub(crate) fn get_root_id<T>(cx: Scope<T>) -> Option<ElementId> {
  11. if let RenderReturn::Sync(Ok(sync)) = cx.root_node() {
  12. sync.root_ids.get(0).and_then(|id| id.get())
  13. } else {
  14. None
  15. }
  16. }