Skip to main content

jaspr_hooks 0.3.0-beta.3 copy "jaspr_hooks: ^0.3.0-beta.3" to clipboard
jaspr_hooks: ^0.3.0-beta.3 copied to clipboard

Native Jaspr hooks for component lifecycle, cached queries, mutations and typed forms with validation, autosave and submission state.

example/example.md

jaspr_hooks example #

This directory contains the static Jaspr Content documentation site and its live, client-island hook demos. The same small counter pattern used throughout the docs can be embedded in any Jaspr application:

import 'package:jaspr/dom.dart';
import 'package:jaspr/jaspr.dart';
import 'package:jaspr_hooks/jaspr_hooks.dart';

class Counter extends HookComponent {
  const Counter({super.key});

  @override
  Component build(BuildContext context) {
    final count = useState(0);

    return button(
      onClick: () => count.value++,
      [text('Count: ${count.value}')],
    );
  }
}

Run the site from this directory with jaspr serve. A production static build uses the configured /jaspr_hooks/ base path for GitHub Pages.

2
likes
160
points
1.31k
downloads

Documentation

Documentation
API reference

Publisher

verified publishercodegrowers.tech

Weekly Downloads

Native Jaspr hooks for component lifecycle, cached queries, mutations and typed forms with validation, autosave and submission state.

Repository (GitHub)
View/report issues
Contributing

Topics

#jaspr #hooks #web #state-management #server-side-rendering

License

MIT (license)

Dependencies

http, jaspr, universal_web, web

More

Packages that depend on jaspr_hooks