Move dioxus-specifc code into dioxus-tui crate and rename core crate to Rink
This commit is contained in:
1 parent
8e8c89c99e
commit
f34fa5d974
55 files changed
+241
-55
No files matched your search
@@ -0,0 +1,22 @@
|
||||
mod button;
|
||||
mod checkbox;
|
||||
mod input;
|
||||
mod number;
|
||||
mod password;
|
||||
mod slider;
|
||||
mod textbox;
|
||||
|
||||
use dioxus_core::{RenderReturn, Scope};
|
||||
use dioxus_native_core::NodeId;
|
||||
pub use input::*;
|
||||
|
||||
use crate::DioxusElementToNodeId;
|
||||
|
||||
pub(crate) fn get_root_id<T>(cx: Scope<T>) -> Option<NodeId> {
|
||||
if let RenderReturn::Ready(sync) = cx.root_node() {
|
||||
let mapping: DioxusElementToNodeId = cx.consume_context()?;
|
||||
mapping.get_node_id(sync.root_ids.get(0)?)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user