use-preact 0.0.1

Preact component metadata primitives for RustUse
Documentation
1
2
3
4
5
6
7
8
9
10
11
use use_preact::{PreactComponentName, PreactHookName, PreactJsxRuntime};

fn main() -> Result<(), use_preact::PreactNameError> {
    let component = PreactComponentName::new("AppShell")?;
    let hook = PreactHookName::new("useSignal")?;

    assert_eq!(component.as_str(), "AppShell");
    assert_eq!(hook.as_str(), "useSignal");
    assert_eq!(PreactJsxRuntime::Automatic.as_str(), "automatic");
    Ok(())
}