Expand description
§use-preact
Preact component metadata primitives for RustUse.
§Experimental
use-preact is experimental while use-js remains below 0.3.0.
§Example
use use_preact::{PreactComponentName, PreactHookName, PreactJsxRuntime};
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");§Scope
- Preact component, hook, JSX runtime, file-kind, and compat-mode metadata.
- Lightweight component and hook name validation.
§Non-goals
- Rendering behavior.
- JSX parsing.
- Compatibility runtime behavior.
§License
Licensed under either Apache-2.0 or MIT.
Structs§
- Preact
Component Name - Validated Preact component name metadata.
- Preact
Hook Name - Validated Preact hook name metadata.
Enums§
- Preact
Compat Mode - Preact compatibility mode labels.
- Preact
File Kind - Preact file-kind labels.
- Preact
JsxRuntime - Preact JSX runtime labels.
- Preact
Name Error - Error returned when Preact metadata is invalid.