Skip to main content

Crate use_react

Crate use_react 

Source
Expand description

§use-react

React component and hook metadata primitives for RustUse.

§Experimental

use-react is experimental while use-js remains below 0.3.0.

§Example

use use_react::{ReactComponentName, ReactHookName, ReactJsxRuntime};

let component = ReactComponentName::new("AppShell")?;
let hook = ReactHookName::new("useSession")?;

assert_eq!(component.as_str(), "AppShell");
assert_eq!(hook.as_str(), "useSession");
assert_eq!(ReactJsxRuntime::Automatic.as_str(), "automatic");

§Scope

  • React component and hook name metadata.
  • JSX runtime and file-kind labels.

§Non-goals

  • React runtime behavior.
  • JSX parsing or transforms.
  • Component rendering or project scaffolding.

§License

Licensed under either Apache-2.0 or MIT.

Structs§

ReactComponentName
Validated React component name metadata.
ReactHookName
Validated React hook name metadata.

Enums§

ReactFileKind
React file-kind metadata.
ReactJsxRuntime
React JSX runtime labels.
ReactNameError
Error returned when React name metadata is invalid.